Make WordPress Core

Changeset 48142


Ignore:
Timestamp:
06/23/2020 06:53:00 PM (4 years ago)
Author:
desrosj
Message:

General: Rename (add|remove)_option_allowed_list() to (add|remove)_allowed_option().

The new names make the purpose more clear. It also adds consistency with the $allowed_options global variable.

Also in this change, the wp-deprecated dependency has been removed from the password strength meter in favor of a window.console.log() call to avoid adding 3 dependencies for one deprecated notice.

Props SergeyBiryukov, ocean90, desrosj
Fixes #50413.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/password-strength-meter.js

    r48124 r48142  
    77
    88(function($){
     9    var __ = wp.i18n.__,
     10        sprintf = wp.i18n.sprintf;
    911
    1012    /**
     
    5961         */
    6062        userInputBlacklist : function() {
    61             wp.deprecated( 'wp.passwordStrength.userInputBlacklist()', {
    62                 alternative: 'wp.passwordStrength.userInputDisallowedList()',
    63                 plugin: 'WordPress',
    64                 hint: wp.i18n.__( 'Please consider writing more inclusive code.' )
    65             } );
     63            window.console.log(
     64                sprintf(
     65                    /* translators: 1: Deprecated  JSfunction name, 2: Version number, 3: Alternative function name. */
     66                    __( '%1$s is deprecated since version %2$s! Use %3$s instead. Please consider writing more inclusive code.' ),
     67                    'wp.passwordStrength.userInputBlacklist()',
     68                    '5.5.0',
     69                    'wp.passwordStrength.userInputDisallowedList()'
     70                )
     71            );
    6672
    6773            return wp.passwordStrength.userInputDisallowedList();
  • trunk/src/wp-admin/includes/plugin.php

    r48121 r48142  
    21552155
    21562156    if ( is_array( $new_whitelist_options ) ) {
    2157         $options = add_option_allowed_list( $new_whitelist_options, $options );
     2157        $options = add_allowed_options( $new_whitelist_options, $options );
    21582158    }
    21592159
     
    21722172 * @return array
    21732173 */
    2174 function add_option_allowed_list( $new_options, $options = '' ) {
     2174function add_allowed_options( $new_options, $options = '' ) {
    21752175    if ( '' === $options ) {
    21762176        global $allowed_options;
  • trunk/src/wp-includes/deprecated.php

    r48121 r48142  
    40434043 *
    40444044 * @since 2.7.0
    4045  * @deprecated 5.5.0 Use add_option_allowed_list() instead.
     4045 * @deprecated 5.5.0 Use add_allowed_options() instead.
    40464046 *                   Please consider writing more inclusive code.
    40474047 *
     
    40534053 */
    40544054function add_option_whitelist( $new_options, $options = '' ) {
    4055     _deprecated_function( __FUNCTION__, '5.5.0', 'add_option_allowed_list()' );
    4056 
    4057     return add_option_allowed_list( $new_options, $options );
     4055    _deprecated_function( __FUNCTION__, '5.5.0', 'add_allowed_options()' );
     4056
     4057    return add_allowed_options( $new_options, $options );
    40584058}
    40594059
  • trunk/src/wp-includes/script-loader.php

    r48121 r48142  
    10651065    );
    10661066
    1067     $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'wp-deprecated', 'zxcvbn-async' ), false, 1 );
     1067    $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'zxcvbn-async' ), false, 1 );
    10681068    did_action( 'init' ) && $scripts->localize(
    10691069        'password-strength-meter',
Note: See TracChangeset for help on using the changeset viewer.