Make WordPress Core

Changeset 36219


Ignore:
Timestamp:
01/07/2016 06:43:11 PM (9 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r36216 r36219  
    12031203            'nav_menus',
    12041204        );
     1205
    12051206        if ( in_array( $id, $core_panels, true ) ) {
    1206             $url = 'https://core.trac.wordpress.org/ticket/33552#comment:12';
    1207             _doing_it_wrong(
    1208                 __METHOD__,
    1209                 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 ),
    1210                 '4.5'
     1207            /* translators: 1: panel id, 2: filter reference URL, 3: filter name */
     1208            $message = sprintf( __( 'Removing %1$s manually will cause PHP warnings. Use the <a href="%2$s">%3$s</a> filter instead.' ),
     1209                $id,
     1210                esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ),
     1211                '<code>customize_loaded_components</code>'
    12111212            );
     1213
     1214            _doing_it_wrong( __METHOD__, $message, '4.5' );
    12121215        }
    12131216        unset( $this->panels[ $id ] );
Note: See TracChangeset for help on using the changeset viewer.