From 43dbe171c37342c4f09ba118e9aea08b321d81fc 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 85e82f25549c67..0179f7f271c685 100644 --- a/docs/designers-developers/developers/backward-compatibility/deprecations.md +++ b/docs/designers-developers/developers/backward-compatibility/deprecations.md @@ -21,6 +21,7 @@ The Gutenberg project's deprecation policy is intended to support backward compa - The PHP function `gutenberg_register_post_prepare_functions` has been removed. - The PHP function `gutenberg_silence_rest_errors` has been removed. - The PHP function `gutenberg_filter_post_type_labels` has been removed. +- 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 630a50434c72fa..cfc8098f151a5d 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -1409,14 +1409,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' );