Make WordPress Core


Ignore:
Timestamp:
06/22/2020 05:24:34 PM (4 years ago)
Author:
desrosj
Message:

General: Remove “whitelist” and “blacklist” in favor of more clear and inclusive language.

“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”

With this commit, all occurrences of “whitelist” and “blacklist” (with the single exception of the $new_whitelist_options global variable) are removed. A new ticket has been opened to explore renaming the $new_whitelist_options variable (#50434).

Changing to more specific names or rewording sentences containing these terms not only makes the code more inclusive, but also helps provide clarity. These terms are often ambiguous. What is being blocked or allowed is not always immediately clear. This can make it more difficult for non-native English speakers to read through the codebase.

Words matter. If one contributor feels more welcome because these terms are removed, this was worth the effort.

Props strangerstudios, jorbin, desrosj, joemcgill, timothyblynjacobs, ocean90, ayeshrajans, davidbaumwald, earnjam.
See #48900, #50434.
Fixes #50413.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r48104 r48121  
    39963996    _deprecated_function( __FUNCTION__, '5.5.0' );
    39973997}
     3998
     3999/**
     4000 * Does comment contain disallowed characters or words.
     4001 *
     4002 * @since 1.5.0
     4003 * @deprecated 5.5.0 Use wp_blocklist_check() instead.
     4004 *                   Please consider writing more inclusive code.
     4005 *
     4006 * @param string $author The author of the comment
     4007 * @param string $email The email of the comment
     4008 * @param string $url The url used in the comment
     4009 * @param string $comment The comment content
     4010 * @param string $user_ip The comment author's IP address
     4011 * @param string $user_agent The author's browser user agent
     4012 * @return bool True if comment contains disallowed content, false if comment does not
     4013 */
     4014function wp_blacklist_check( $author, $email, $url, $comment, $user_ip, $user_agent ) {
     4015    _deprecated_function( __FUNCTION__, '5.5.0', 'wp_blocklist_check()' );
     4016
     4017    return wp_blocklist_check( $author, $email, $url, $comment, $user_ip, $user_agent );
     4018}
     4019
     4020/**
     4021 * Filters out `register_meta()` args based on an allowed list.
     4022 *
     4023 * `register_meta()` args may change over time, so requiring the allowed list
     4024 * to be explicitly turned off is a warranty seal of sorts.
     4025 *
     4026 * @access private
     4027 * @since 4.6.0
     4028 * @deprecated 5.5.0 Use _wp_register_meta_args_allowed_list() instead.
     4029 *                   Please consider writing more inclusive code.
     4030 *
     4031 * @param array $args         Arguments from `register_meta()`.
     4032 * @param array $default_args Default arguments for `register_meta()`.
     4033 * @return array Filtered arguments.
     4034 */
     4035function _wp_register_meta_args_whitelist( $args, $default_args ) {
     4036    _deprecated_function( __FUNCTION__, '5.5.0', '_wp_register_meta_args_allowed_list()' );
     4037
     4038    return _wp_register_meta_args_allowed_list( $args, $default_args );
     4039}
     4040
     4041/**
     4042 * Adds an array of options to the list of allowed options.
     4043 *
     4044 * @since 2.7.0
     4045 * @deprecated 5.5.0 Use add_option_allowed_list() instead.
     4046 *                   Please consider writing more inclusive code.
     4047 *
     4048 * @global array $allowed_options
     4049 *
     4050 * @param array        $new_options
     4051 * @param string|array $options
     4052 * @return array
     4053 */
     4054function 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 );
     4058}
     4059
     4060/**
     4061 * Removes a list of options from the allowed options list.
     4062 *
     4063 * @since 2.7.0
     4064 * @deprecated 5.5.0 Use remove_option_allowed_list() instead.
     4065 *                   Please consider writing more inclusive code.
     4066 *
     4067 * @global array $allowed_options
     4068 *
     4069 * @param array        $del_options
     4070 * @param string|array $options
     4071 * @return array
     4072 */
     4073function remove_option_whitelist( $del_options, $options = '' ) {
     4074    _deprecated_function( __FUNCTION__, '5.5.0', 'remove_option_allowed_list()' );
     4075
     4076    return remove_option_allowed_list( $del_options, $options );
     4077}
Note: See TracChangeset for help on using the changeset viewer.