From c5b1a12a558810d615ee46970aa71992696f18eb Mon Sep 17 00:00:00 2001 From: desrosj Date: Tue, 23 Jun 2020 18:54:16 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@48142 git-svn-id: http://core.svn.wordpress.org/trunk@47911 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/plugin.php | 4 ++-- wp-admin/js/password-strength-meter.js | 16 +++++++++++----- wp-admin/js/password-strength-meter.min.js | 2 +- wp-includes/deprecated.php | 6 +++--- wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 3492b15ee2..3220c8182f 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -2154,7 +2154,7 @@ function option_update_filter( $options ) { global $new_whitelist_options; if ( is_array( $new_whitelist_options ) ) { - $options = add_option_allowed_list( $new_whitelist_options, $options ); + $options = add_allowed_options( $new_whitelist_options, $options ); } return $options; @@ -2171,7 +2171,7 @@ function option_update_filter( $options ) { * @param string|array $options * @return array */ -function add_option_allowed_list( $new_options, $options = '' ) { +function add_allowed_options( $new_options, $options = '' ) { if ( '' === $options ) { global $allowed_options; } else { diff --git a/wp-admin/js/password-strength-meter.js b/wp-admin/js/password-strength-meter.js index 43a38ba403..a2e0510862 100644 --- a/wp-admin/js/password-strength-meter.js +++ b/wp-admin/js/password-strength-meter.js @@ -6,6 +6,8 @@ window.wp = window.wp || {}; (function($){ + var __ = wp.i18n.__, + sprintf = wp.i18n.sprintf; /** * Contains functions to determine the password strength. @@ -58,11 +60,15 @@ window.wp = window.wp || {}; * @return {string[]} The array of words to be disallowed. */ userInputBlacklist : function() { - wp.deprecated( 'wp.passwordStrength.userInputBlacklist()', { - alternative: 'wp.passwordStrength.userInputDisallowedList()', - plugin: 'WordPress', - hint: wp.i18n.__( 'Please consider writing more inclusive code.' ) - } ); + window.console.log( + sprintf( + /* translators: 1: Deprecated JSfunction name, 2: Version number, 3: Alternative function name. */ + __( '%1$s is deprecated since version %2$s! Use %3$s instead. Please consider writing more inclusive code.' ), + 'wp.passwordStrength.userInputBlacklist()', + '5.5.0', + 'wp.passwordStrength.userInputDisallowedList()' + ) + ); return wp.passwordStrength.userInputDisallowedList(); }, diff --git a/wp-admin/js/password-strength-meter.min.js b/wp-admin/js/password-strength-meter.min.js index d72b3082d7..363424c9f3 100644 --- a/wp-admin/js/password-strength-meter.min.js +++ b/wp-admin/js/password-strength-meter.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -window.wp=window.wp||{},function(o){wp.passwordStrength={meter:function(e,t,n){return o.isArray(t)||(t=[t.toString()]),e!=n&&n&&0add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'wp-deprecated', 'zxcvbn-async' ), false, 1 ); + $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'zxcvbn-async' ), false, 1 ); did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', diff --git a/wp-includes/version.php b/wp-includes/version.php index b6c320d6ce..6070c78b8d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48141'; +$wp_version = '5.5-alpha-48142'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.