Remote block patterns from wp.org were to be loaded through a callback hooked into the `current_screen` filter. Within 2 callbacks, i.e. `_load_remote_featured_patterns()` and `_load_remote_block_patterns()`, a guard clause bailed out early if the `$current_screen->is_block_editor` is `false`.
However, the `current_screen` filter is unreliable to detect the block editor. Why? In the block and Site Editor screens, `$current_scren->is_block_editor` is not set until after the filter is executed. Whoopsie.
This commit no longer uses the `current_screen` filter. Instead, it explicitly loads the remote block patterns by invoking both private functions (now not callbacks) directly in the screen files for the block and site editor screens.
With this change, passing `WP_Screen` object into these functions is no longer needed. As the `_load_remote_block_patterns()` function was introduced in 5.8.0, its function parameter is now deprecated and the guard clause retained for backwards compatibility.
Follow-up to [51021], [52377].
Props poena, noisysocks, peterwilsoncc, hellofromTonya, audrasjb.
Fixes#54806.
Built from https://develop.svn.wordpress.org/trunk@52593
git-svn-id: http://core.svn.wordpress.org/trunk@52181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Because the `__()` translation function was used here, the Query block pattern category string is not translatable. `_x()` is the correct function here as that passes the second parameter as context and not text domain.
Follow up to [50948].
Props walbo.
Fixes#53577.
Built from https://develop.svn.wordpress.org/trunk@51307
git-svn-id: http://core.svn.wordpress.org/trunk@50916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add an endpoint for fetching block patterns from WordPress.org, and load the block patterns from this new API. Remove the block patterns that have already been moved to WordPress.org/patterns.
Props ryelle, iandunn, youknowriad, timothyblynjacobs.
Fixes#53246.
Built from https://develop.svn.wordpress.org/trunk@51021
git-svn-id: http://core.svn.wordpress.org/trunk@50630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the block patterns included by default on WordPress
to give them more personality and to make use of the design tools
that has been added to the editor.
Props onemaggie, melchoyce, kjellr, beafialho, gziolo.
Fixes#52846.
Built from https://develop.svn.wordpress.org/trunk@50794
git-svn-id: http://core.svn.wordpress.org/trunk@50403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
WordPress Core comes by default with a number of block patterns and a frequent request was to be able to opt-out of the Core block patterns.
You can now opt-out using remove_theme_support( 'core-block-patterns' )
Props desrosj, nosolosw.
Fixes#50669.
Built from https://develop.svn.wordpress.org/trunk@48492
git-svn-id: http://core.svn.wordpress.org/trunk@48254 1a063a9b-81f0-0310-95a4-ce76da25c4cd