From 0b8c6eed83d631fe990d3bb8ac4170db464c1f63 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Thu, 7 Jan 2016 18:44:28 +0000 Subject: [PATCH] Customizer: Improve `_doing_it_wrong()` message when `widgets` or `nav_menus` are manually removed via `WP_Customize_Manager::remove_panel()`. * Link to code reference page for `customize_loaded_components` instead of linking to a Trac comment. * Remove HTML code from being included in translated string. * Add missing translator comment for the specifiers in the translated string. Amends [36216]. Props DrewAPicture. Fixes #35242. Built from https://develop.svn.wordpress.org/trunk@36219 git-svn-id: http://core.svn.wordpress.org/trunk@36186 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-manager.php | 13 ++++++++----- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index e556f5ee27..66fb7ff24f 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -1202,13 +1202,16 @@ final class WP_Customize_Manager { 'widgets', 'nav_menus', ); + if ( in_array( $id, $core_panels, true ) ) { - $url = 'https://core.trac.wordpress.org/ticket/33552#comment:12'; - _doing_it_wrong( - __METHOD__, - sprintf( __( 'Removing %1$s manually will cause PHP warnings. Use the customize_loaded_components filter instead. See %2$s.' ), $id, $url ), - '4.5' + /* translators: 1: panel id, 2: filter reference URL, 3: filter name */ + $message = sprintf( __( 'Removing %1$s manually will cause PHP warnings. Use the %3$s filter instead.' ), + $id, + esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ), + 'customize_loaded_components' ); + + _doing_it_wrong( __METHOD__, $message, '4.5' ); } unset( $this->panels[ $id ] ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2716d92340..7e4265d7dc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36218'; +$wp_version = '4.5-alpha-36219'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.