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
This commit is contained in:
Weston Ruter 2016-01-07 18:44:28 +00:00
parent 0075480202
commit 0b8c6eed83
2 changed files with 9 additions and 6 deletions

View File

@ -1202,13 +1202,16 @@ final class WP_Customize_Manager {
'widgets', 'widgets',
'nav_menus', 'nav_menus',
); );
if ( in_array( $id, $core_panels, true ) ) { if ( in_array( $id, $core_panels, true ) ) {
$url = 'https://core.trac.wordpress.org/ticket/33552#comment:12'; /* translators: 1: panel id, 2: filter reference URL, 3: filter name */
_doing_it_wrong( $message = sprintf( __( 'Removing %1$s manually will cause PHP warnings. Use the <a href="%2$s">%3$s</a> filter instead.' ),
__METHOD__, $id,
sprintf( __( 'Removing %1$s manually will cause PHP warnings. Use the <code>customize_loaded_components</code> filter instead. See <a href="%2$s">%2$s</a>.' ), $id, $url ), esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ),
'4.5' '<code>customize_loaded_components</code>'
); );
_doing_it_wrong( __METHOD__, $message, '4.5' );
} }
unset( $this->panels[ $id ] ); unset( $this->panels[ $id ] );
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.