General: Rename the $new_whitelist_options global variable.

This change renames `$new_whitelist_options` to `$new_allowed_options`. This makes the variable’s purpose more clear, and promotes using more inclusive language.

For backwards compatibility, the new variable is passed by reference to the old one.

Follow up to [48121].

Props ayeshrajans, desrosj, jorbin, SergeyBiryukov.
See #50413.
Fixes #50434.

git-svn-id: https://develop.svn.wordpress.org/trunk@48477 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2020-07-14 12:31:22 +00:00
parent 0ee9100e6d
commit 7bdff387e2
2 changed files with 29 additions and 11 deletions

View File

@@ -2167,17 +2167,19 @@ function user_can_access_admin_page() {
* See the {@see 'allowed_options'} filter.
*
* @since 2.7.0
* @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`.
* Please consider writing more inclusive code.
*
* @global array $new_whitelist_options
* @global array $new_allowed_options
*
* @param array $options
* @return array
*/
function option_update_filter( $options ) {
global $new_whitelist_options;
global $new_allowed_options;
if ( is_array( $new_whitelist_options ) ) {
$options = add_allowed_options( $new_whitelist_options, $options );
if ( is_array( $new_allowed_options ) ) {
$options = add_allowed_options( $new_allowed_options, $options );
}
return $options;