From db3592db9ba603a07dd5a8f5905cc8ca28988481 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 23 Jan 2019 18:21:12 -0500 Subject: [PATCH] Plugin: Deprecate gutenberg_load_list_reusable_blocks --- .../backward-compatibility/deprecations.md | 1 + lib/client-assets.php | 12 +++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/designers-developers/developers/backward-compatibility/deprecations.md b/docs/designers-developers/developers/backward-compatibility/deprecations.md index b5df2462e1050..03608d2634ff5 100644 --- a/docs/designers-developers/developers/backward-compatibility/deprecations.md +++ b/docs/designers-developers/developers/backward-compatibility/deprecations.md @@ -36,6 +36,7 @@ The Gutenberg project's deprecation policy is intended to support backward compa - The PHP function `gutenberg_register_post_types` has been removed. - The `gutenberg` theme support option has been removed. Use [`align-wide`](https://wordpress.org/gutenberg/handbook/designers-developers/developers/themes/theme-support/#wide-alignment) instead. - The PHP function `gutenberg_prepare_blocks_for_js` has been removed. Use [`get_block_editor_server_block_settings`](https://developer.wordpress.org/reference/functions/get_block_editor_server_block_settings/) instead. +- The PHP function `gutenberg_load_list_reusable_blocks` has been removed. ## 4.5.0 - `Dropdown.refresh()` has been deprecated as the contained `Popover` is now automatically refreshed. diff --git a/lib/client-assets.php b/lib/client-assets.php index d33ebdd12fe93..15ffc18d86516 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -1325,14 +1325,8 @@ function gutenberg_editor_scripts_and_styles( $hook ) { /** * Enqueue the reusable blocks listing page's script * - * @param string $hook Screen name. + * @deprecated 5.0.0 */ -function gutenberg_load_list_reusable_blocks( $hook ) { - $is_reusable_blocks_list_page = 'edit.php' === $hook && isset( $_GET['post_type'] ) && 'wp_block' === $_GET['post_type']; - if ( $is_reusable_blocks_list_page ) { - gutenberg_load_locale_data(); - wp_enqueue_script( 'wp-list-reusable-blocks' ); - wp_enqueue_style( 'wp-list-reusable-blocks' ); - } +function gutenberg_load_list_reusable_blocks() { + _deprecated_function( __FUNCTION__, '5.0.0' ); } -add_action( 'admin_enqueue_scripts', 'gutenberg_load_list_reusable_blocks' );