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.

git-svn-id: https://develop.svn.wordpress.org/trunk@48121 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2020-06-22 17:24:34 +00:00
parent 9e3b322f8f
commit e26394bb2d
60 changed files with 423 additions and 281 deletions

View File

@@ -40,12 +40,12 @@ class WP_UnitTest_Factory_For_Blog extends WP_UnitTest_Factory_For_Thing {
}
if ( isset( $args['meta'] ) ) {
// The `$site_data_whitelist` matches the one used in `wpmu_create_blog()`.
$site_data_whitelist = array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );
// The `$allowed_data_fields` matches the one used in `wpmu_create_blog()`.
$allowed_data_fields = array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );
foreach ( $args['meta'] as $key => $value ) {
// Promote whitelisted keys to top-level arguments, add others to the options array.
if ( in_array( $key, $site_data_whitelist, true ) ) {
// Promote allowed keys to top-level arguments, add others to the options array.
if ( in_array( $key, $allowed_data_fields, true ) ) {
$args[ $key ] = $value;
} else {
$args['options'][ $key ] = $value;

View File

@@ -159,7 +159,7 @@ class Tests_Admin_Includes_Schema extends WP_UnitTestCase {
'use_quicktags' => '1',
),
array(
// This option is on a blacklist and should never exist.
// This option disallowed and should never exist.
'use_quicktags' => false,
),
),

View File

@@ -4,7 +4,7 @@
* @group comment
*/
class Tests_Comment_CheckComment extends WP_UnitTestCase {
public function test_should_return_true_when_comment_whitelist_is_disabled() {
public function test_should_return_true_when_comment_previously_approved_is_disabled() {
$author = 'BobtheBuilder';
$author_email = 'bob@example.com';
$author_url = 'http://example.com';
@@ -13,12 +13,12 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
$user_agent = '';
$comment_type = '';
update_option( 'comment_whitelist', 0 );
update_option( 'comment_previously_approved', 0 );
$results = check_comment( $author, $author_email, $author_url, $comment, $author_ip, $user_agent, $comment_type );
$this->assertTrue( $results );
}
public function test_should_return_false_when_comment_whitelist_is_enabled_and_author_does_not_have_approved_comment() {
public function test_should_return_false_when_comment_previously_approved_is_enabled_and_author_does_not_have_approved_comment() {
$author = 'BobtheBuilder';
$author_email = 'bob@example.com';
$author_url = 'http://example.com';
@@ -27,13 +27,13 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
$user_agent = '';
$comment_type = '';
update_option( 'comment_whitelist', 1 );
update_option( 'comment_previously_approved', 1 );
$results = check_comment( $author, $author_email, $author_url, $comment, $author_ip, $user_agent, $comment_type );
$this->assertFalse( $results );
}
public function test_should_return_true_when_comment_whitelist_is_enabled_and_author_has_approved_comment() {
public function test_should_return_true_when_comment_previously_approved_is_enabled_and_author_has_approved_comment() {
$post_id = self::factory()->post->create();
$prev_args = array(
'comment_post_ID' => $post_id,
@@ -44,7 +44,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
);
$prev_comment_id = self::factory()->comment->create( $prev_args );
update_option( 'comment_whitelist', 1 );
update_option( 'comment_previously_approved', 1 );
$author = 'BobtheBuilder';
$author_email = 'bob@example.com';
@@ -69,7 +69,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
}
public function test_should_return_false_when_content_matches_moderation_key() {
update_option( 'comment_whitelist', 0 );
update_option( 'comment_previously_approved', 0 );
$author = 'WendytheBuilder';
$author_email = 'wendy@example.com';
@@ -85,7 +85,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
}
public function test_should_return_true_when_content_does_not_match_moderation_keys() {
update_option( 'comment_whitelist', 0 );
update_option( 'comment_previously_approved', 0 );
$author = 'WendytheBuilder';
$author_email = 'wendy@example.com';
@@ -101,7 +101,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
}
public function test_should_return_false_when_link_count_exceeds_comment_max_length_setting() {
update_option( 'comment_whitelist', 0 );
update_option( 'comment_previously_approved', 0 );
$author = 'BobtheBuilder';
$author_email = 'bob@example.com';
@@ -117,7 +117,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
}
public function test_should_return_true_when_link_count_does_not_exceed_comment_max_length_setting() {
update_option( 'comment_whitelist', 0 );
update_option( 'comment_previously_approved', 0 );
$author = 'BobtheBuilder';
$author_email = 'bob@example.com';
@@ -135,7 +135,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
/**
* @ticket 28603
*/
public function test_should_return_true_when_comment_whitelist_is_enabled_and_user_has_previously_approved_comments_with_different_email() {
public function test_should_return_true_when_comment_previously_approved_is_enabled_and_user_has_previously_approved_comments_with_different_email() {
$subscriber_id = $this->factory()->user->create(
array(
'role' => 'subscriber',
@@ -158,7 +158,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
wp_update_user( $subscriber_user );
update_option( 'comment_whitelist', 1 );
update_option( 'comment_previously_approved', 1 );
$results = check_comment( 'foo', 'newsub@example.com', 'http://example.com', 'This is a comment.', '66.155.40.249', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0', 'comment', 4 );
$this->assertTrue( $results );
@@ -167,7 +167,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
/**
* @ticket 28603
*/
public function test_should_return_false_when_comment_whitelist_is_enabled_and_user_does_not_have_a_previously_approved_comment_with_any_email() {
public function test_should_return_false_when_comment_previously_approved_is_enabled_and_user_does_not_have_a_previously_approved_comment_with_any_email() {
$subscriber_id = $this->factory()->user->create(
array(
'role' => 'subscriber',
@@ -180,7 +180,7 @@ class Tests_Comment_CheckComment extends WP_UnitTestCase {
wp_update_user( $subscriber_user );
update_option( 'comment_whitelist', 1 );
update_option( 'comment_previously_approved', 1 );
$results = check_comment( 'bar', 'zag@example.com', 'http://example.com', 'This is my first comment.', '66.155.40.249', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0', 'comment', 4 );
$this->assertFalse( $results );

View File

@@ -22,14 +22,14 @@ class Tests_Comment_WpAllowComment extends WP_UnitTestCase {
)
);
update_option( 'comment_whitelist', 0 );
update_option( 'comment_previously_approved', 0 );
}
function tearDown() {
wp_delete_post( self::$post_id, true );
wp_delete_comment( self::$comment_id, true );
update_option( 'comment_whitelist', 1 );
update_option( 'comment_previously_approved', 1 );
}
public function test_allow_comment_if_comment_author_emails_differ() {

View File

@@ -3,9 +3,9 @@
/**
* @group comment
*/
class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
class Tests_WP_Blocklist_Check extends WP_UnitTestCase {
public function test_should_return_true_when_content_matches_blacklist_keys() {
public function test_should_return_true_when_content_matches_blocklist_keys() {
$author = 'Sting';
$author_email = 'sting@example.com';
$author_url = 'http://example.com';
@@ -13,9 +13,9 @@ class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
$author_ip = '192.168.0.1';
$user_agent = '';
update_option( 'blacklist_keys', "well\nfoo" );
update_option( 'blocklist_keys', "well\nfoo" );
$result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$this->assertTrue( $result );
}
@@ -23,7 +23,7 @@ class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
/**
* @ticket 37208
*/
public function test_should_return_true_when_content_with_html_matches_blacklist_keys() {
public function test_should_return_true_when_content_with_html_matches_blocklist_keys() {
$author = 'Sting';
$author_email = 'sting@example.com';
$author_url = 'http://example.com';
@@ -31,14 +31,14 @@ class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
$author_ip = '192.168.0.1';
$user_agent = '';
update_option( 'blacklist_keys', "halfway\nfoo" );
update_option( 'blocklist_keys', "halfway\nfoo" );
$result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$this->assertTrue( $result );
}
public function test_should_return_true_when_author_matches_blacklist_keys() {
public function test_should_return_true_when_author_matches_blocklist_keys() {
$author = 'Sideshow Mel';
$author_email = 'mel@example.com';
$author_url = 'http://example.com';
@@ -46,14 +46,14 @@ class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
$author_ip = '192.168.0.1';
$user_agent = '';
update_option( 'blacklist_keys', "sideshow\nfoo" );
update_option( 'blocklist_keys', "sideshow\nfoo" );
$result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$this->assertTrue( $result );
}
public function test_should_return_true_when_url_matches_blacklist_keys() {
public function test_should_return_true_when_url_matches_blocklist_keys() {
$author = 'Rainier Wolfcastle';
$author_email = 'rainier@wolfcastle.com';
$author_url = 'http://example.com';
@@ -61,9 +61,9 @@ class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
$author_ip = '192.168.0.1';
$user_agent = '';
update_option( 'blacklist_keys', "example\nfoo" );
update_option( 'blocklist_keys', "example\nfoo" );
$result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$this->assertTrue( $result );
}
@@ -71,7 +71,7 @@ class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
/**
* @ticket 37208
*/
public function test_should_return_true_when_link_matches_blacklist_keys() {
public function test_should_return_true_when_link_matches_blocklist_keys() {
$author = 'Rainier Wolfcastle';
$author_email = 'rainier@wolfcastle.com';
$author_url = 'http://example.com';
@@ -79,9 +79,9 @@ class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
$author_ip = '192.168.0.1';
$user_agent = '';
update_option( 'blacklist_keys', '/spam/' );
update_option( 'blocklist_keys', '/spam/' );
$result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$this->assertTrue( $result );
}
@@ -94,9 +94,9 @@ class Tests_WP_Blacklist_Check extends WP_UnitTestCase {
$author_ip = '192.168.0.1';
$user_agent = '';
update_option( 'blacklist_keys', "sideshow\nfoobar" );
update_option( 'blocklist_keys', "sideshow\nfoobar" );
$result = wp_blacklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$result = wp_blocklist_check( $author, $author_email, $author_url, $comment, $author_ip, $user_agent );
$this->assertFalse( $result );
}

View File

@@ -1473,7 +1473,7 @@ EOF;
$expected = '';
foreach ( $image_meta['sizes'] as $name => $size ) {
// Whitelist the sizes that should be included so we pick up 'medium_large' in 4.4.
// Allow the sizes that should be included so we pick up 'medium_large' in 4.4.
if ( in_array( $name, $intermediates, true ) ) {
$expected .= $uploads_dir_url . $year_month . '/' . $size['file'] . ' ' . $size['width'] . 'w, ';
}
@@ -1518,7 +1518,7 @@ EOF;
$expected = '';
foreach ( $image_meta['sizes'] as $name => $size ) {
// Whitelist the sizes that should be included so we pick up 'medium_large' in 4.4.
// Allow the sizes that should be included so we pick up 'medium_large' in 4.4.
if ( in_array( $name, $intermediates, true ) ) {
$expected .= $uploads_dir_url . $size['file'] . ' ' . $size['width'] . 'w, ';
}
@@ -1595,7 +1595,7 @@ EOF;
$expected = '';
foreach ( $image_meta['sizes'] as $name => $size ) {
// Whitelist the sizes that should be included so we pick up 'medium_large' in 4.4.
// Allow the sizes that should be included so we pick up 'medium_large' in 4.4.
if ( in_array( $name, $intermediates, true ) ) {
$expected .= $uploads_dir_url . $year_month . '/' . $size['file'] . ' ' . $size['width'] . 'w, ';
}
@@ -1874,7 +1874,7 @@ EOF;
$expected = '';
foreach ( $image_meta['sizes'] as $name => $size ) {
// Whitelist the sizes that should be included so we pick up 'medium_large' in 4.4.
// Allow the sizes that should be included so we pick up 'medium_large' in 4.4.
if ( in_array( $name, $intermediates, true ) ) {
$expected .= $uploads_dir . $year_month . '/' . $size['file'] . ' ' . $size['width'] . 'w, ';
}

View File

@@ -2461,14 +2461,14 @@ if ( is_multisite() ) :
public function data_wpmu_new_blog_action_backward_commpatible() {
return array(
'default values' => array(
'default values' => array(
array(),
array(
'public' => 0, // `public` is one of the default metas in `wpmu_create_blog()' function prior to WordPress 5.1.0.
'WPLANG' => 'en_US', // WPLANG is another default meta in `wpmu_create_blog()` function prior to WordPress 5.1.0.
),
),
'public site' => array(
'public site' => array(
array(
'public' => 1,
),
@@ -2477,7 +2477,7 @@ if ( is_multisite() ) :
'WPLANG' => 'en_US',
),
),
'all whitelisted' => array(
'allowed_keys' => array(
array(
'public' => -1,
'archived' => 0,
@@ -2497,7 +2497,7 @@ if ( is_multisite() ) :
'lang_id' => 11,
),
),
'extra meta key' => array(
'extra meta key' => array(
array(
'foo' => 'bar',
),

View File

@@ -9,101 +9,101 @@ if ( is_multisite() ) :
*/
class Tests_Multisite_Site_Details extends WP_UnitTestCase {
/**
* @dataProvider data_whitelisted_options
* @dataProvider data_allowed_options
*
* @ticket 40063
*/
public function test_update_whitelisted_option_deletes_site_details_cache( $whitelisted_option, $temporary_value ) {
public function test_update_allowed_option_deletes_site_details_cache( $allowed_option, $temporary_value ) {
$site = get_site();
$original_value = $site->$whitelisted_option;
update_option( $whitelisted_option, $temporary_value );
$original_value = $site->$allowed_option;
update_option( $allowed_option, $temporary_value );
$cached_result = wp_cache_get( $site->id, 'site-details' );
/* Reset to original value. */
update_option( $whitelisted_option, $original_value );
update_option( $allowed_option, $original_value );
$this->assertFalse( $cached_result );
}
/**
* @dataProvider data_whitelisted_options
* @dataProvider data_allowed_options
*
* @ticket 40063
*/
public function test_update_whitelisted_option_deletes_blog_details_cache( $whitelisted_option, $temporary_value ) {
public function test_update_allowed_option_deletes_blog_details_cache( $allowed_option, $temporary_value ) {
$blog_details = get_blog_details();
$original_value = $blog_details->$whitelisted_option;
update_option( $whitelisted_option, $temporary_value );
$original_value = $blog_details->$allowed_option;
update_option( $allowed_option, $temporary_value );
$cached_result = wp_cache_get( $blog_details->id, 'blog-details' );
/* Reset to original value. */
update_option( $whitelisted_option, $original_value );
update_option( $allowed_option, $original_value );
$this->assertFalse( $cached_result );
}
/**
* @dataProvider data_whitelisted_options
* @dataProvider data_allowed_options
*
* @ticket 40063
*/
public function test_update_whitelisted_option_does_not_delete_site_cache( $whitelisted_option, $temporary_value ) {
public function test_update_allowed_option_does_not_delete_site_cache( $allowed_option, $temporary_value ) {
$site = get_site();
$original_value = $site->$whitelisted_option;
update_option( $whitelisted_option, $temporary_value );
$original_value = $site->$allowed_option;
update_option( $allowed_option, $temporary_value );
$cached_result = wp_cache_get( $site->id, 'sites' );
/* Reset to original value. */
update_option( $whitelisted_option, $original_value );
update_option( $allowed_option, $original_value );
$this->assertNotFalse( $cached_result );
}
/**
* @dataProvider data_whitelisted_options
* @dataProvider data_allowed_options
*
* @ticket 40063
*/
public function test_update_whitelisted_option_does_not_delete_short_blog_details_cache( $whitelisted_option, $temporary_value ) {
public function test_update_allowed_option_does_not_delete_short_blog_details_cache( $allowed_option, $temporary_value ) {
$blog_details = get_blog_details( null, false );
$original_value = get_option( $whitelisted_option );
update_option( $whitelisted_option, $temporary_value );
$original_value = get_option( $allowed_option );
update_option( $allowed_option, $temporary_value );
$cached_result = wp_cache_get( $blog_details->id . 'short', 'blog-details' );
/* Reset to original value. */
update_option( $whitelisted_option, $original_value );
update_option( $allowed_option, $original_value );
$this->assertNotFalse( $cached_result );
}
/**
* @dataProvider data_whitelisted_options
* @dataProvider data_allowed_options
*
* @ticket 40063
*/
public function test_update_whitelisted_option_does_not_update_sites_last_changed( $whitelisted_option, $temporary_value ) {
public function test_update_allowed_option_does_not_update_sites_last_changed( $allowed_option, $temporary_value ) {
$last_changed = wp_cache_get_last_changed( 'sites' );
$original_value = get_option( $whitelisted_option );
update_option( $whitelisted_option, $temporary_value );
$original_value = get_option( $allowed_option );
update_option( $allowed_option, $temporary_value );
$new_last_changed = wp_cache_get_last_changed( 'sites' );
/* Reset to original value. */
update_option( $whitelisted_option, $original_value );
update_option( $allowed_option, $original_value );
$this->assertSame( $new_last_changed, $last_changed );
}
public function data_whitelisted_options() {
public function data_allowed_options() {
return array(
array( 'blogname', 'Custom Site' ),
array( 'home', 'http://custom-site-url.org' ),

View File

@@ -54,7 +54,7 @@ if ( is_multisite() ) :
remove_filter( 'is_email', '__return_false' );
}
public function test_should_fail_for_emails_from_non_whitelisted_domains() {
public function test_should_fail_for_emails_from_disallowed_domains() {
$domains = array( 'foo.com', 'bar.org' );
update_site_option( 'limited_email_domains', $domains );
@@ -62,7 +62,7 @@ if ( is_multisite() ) :
$this->assertContains( 'user_email', $v['errors']->get_error_codes() );
}
public function test_should_not_fail_for_emails_from_whitelisted_domains_with_mixed_case() {
public function test_should_not_fail_for_emails_from_allowed_domains_with_mixed_case() {
$domains = array( 'foo.com', 'bar.org' );
update_site_option( 'limited_email_domains', $domains );

View File

@@ -466,7 +466,7 @@ class Tests_Post_Attachments extends WP_UnitTestCase {
public function test_wp_attachment_is_default() {
// On Multisite, psd is not an allowed mime type by default.
if ( is_multisite() ) {
add_filter( 'upload_mimes', array( $this, 'whitelist_psd_mime_type' ), 10, 2 );
add_filter( 'upload_mimes', array( $this, 'allow_psd_mime_type' ), 10, 2 );
}
$filename = DIR_TESTDATA . '/images/test-image.psd';
@@ -481,7 +481,7 @@ class Tests_Post_Attachments extends WP_UnitTestCase {
$this->assertFalse( wp_attachment_is( 'video', $attachment_id ) );
if ( is_multisite() ) {
remove_filter( 'upload_mimes', array( $this, 'whitelist_psd_mime_type' ), 10, 2 );
remove_filter( 'upload_mimes', array( $this, 'allow_psd_mime_type' ), 10, 2 );
}
}
@@ -493,21 +493,21 @@ class Tests_Post_Attachments extends WP_UnitTestCase {
$this->assertFalse( $upload['error'] );
add_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) );
add_filter( 'upload_mimes', array( $this, 'disallow_jpg_mime_type' ) );
$upload = wp_upload_bits( wp_basename( $filename ), null, $contents );
remove_filter( 'upload_mimes', array( $this, 'blacklist_jpg_mime_type' ) );
remove_filter( 'upload_mimes', array( $this, 'disallow_jpg_mime_type' ) );
$this->assertNotEmpty( $upload['error'] );
}
public function whitelist_psd_mime_type( $mimes ) {
public function allow_psd_mime_type( $mimes ) {
$mimes['psd'] = 'application/octet-stream';
return $mimes;
}
public function blacklist_jpg_mime_type( $mimes ) {
public function disallow_jpg_mime_type( $mimes ) {
unset( $mimes['jpg|jpeg|jpe'] );
return $mimes;
}

View File

@@ -128,9 +128,9 @@ class Tests_Post_WpUniquePostSlug extends WP_UnitTestCase {
}
/**
* @dataProvider whitelist_post_statuses
* @dataProvider allowed_post_statuses
*/
public function test_whitelisted_post_statuses_should_not_be_forced_to_be_unique( $status ) {
public function test_allowed_post_statuses_should_not_be_forced_to_be_unique( $status ) {
$p1 = self::factory()->post->create(
array(
'post_type' => 'post',
@@ -149,7 +149,7 @@ class Tests_Post_WpUniquePostSlug extends WP_UnitTestCase {
$this->assertSame( 'foo', $actual );
}
public function whitelist_post_statuses() {
public function allowed_post_statuses() {
return array(
array( 'draft' ),
array( 'pending' ),

View File

@@ -378,7 +378,7 @@ class Tests_REST_API extends WP_UnitTestCase {
}
/**
* Ensure that result fields are not whitelisted if no request['_fields'] is present.
* Ensure that result fields are not allowed if no request['_fields'] is present.
*/
public function test_rest_filter_response_fields_no_request_filter() {
$response = new WP_REST_Response();
@@ -390,7 +390,7 @@ class Tests_REST_API extends WP_UnitTestCase {
}
/**
* Ensure that result fields are whitelisted if request['_fields'] is present.
* Ensure that result fields are allowed if request['_fields'] is present.
*/
public function test_rest_filter_response_fields_single_field_filter() {
$response = new WP_REST_Response();
@@ -410,7 +410,7 @@ class Tests_REST_API extends WP_UnitTestCase {
}
/**
* Ensure that multiple comma-separated fields may be whitelisted with request['_fields'].
* Ensure that multiple comma-separated fields may be allowed with request['_fields'].
*/
public function test_rest_filter_response_fields_multi_field_filter() {
$response = new WP_REST_Response();
@@ -440,7 +440,7 @@ class Tests_REST_API extends WP_UnitTestCase {
}
/**
* Ensure that multiple comma-separated fields may be whitelisted
* Ensure that multiple comma-separated fields may be allowed
* with request['_fields'] using query parameter array syntax.
*/
public function test_rest_filter_response_fields_multi_field_filter_array() {
@@ -472,7 +472,7 @@ class Tests_REST_API extends WP_UnitTestCase {
}
/**
* Ensure that request['_fields'] whitelists apply to items in response collections.
* Ensure that request['_fields'] allowed list apply to items in response collections.
*/
public function test_rest_filter_response_fields_numeric_array() {
$response = new WP_REST_Response();
@@ -520,7 +520,7 @@ class Tests_REST_API extends WP_UnitTestCase {
}
/**
* Ensure that nested fields may be whitelisted with request['_fields'].
* Ensure that nested fields may be allowed with request['_fields'].
*
* @ticket 42094
*/

View File

@@ -1054,9 +1054,9 @@ class Tests_Widgets extends WP_UnitTestCase {
'array_version' => 3,
);
$whitelist = array( 'tag_cloud-1', 'text-1' );
$allowed_widgets = array( 'tag_cloud-1', 'text-1' );
$filtered_widgets = _wp_remove_unregistered_widgets( $widgets, $whitelist );
$filtered_widgets = _wp_remove_unregistered_widgets( $widgets, $allowed_widgets );
$this->assertInternalType( 'array', $filtered_widgets );
$this->assertArrayHasKey( 'fantasy', $filtered_widgets );

View File

@@ -602,7 +602,7 @@ class Test_WP_Widget_Text extends WP_UnitTestCase {
$this->assertTrue( $widget->is_legacy_instance( $instance ), 'Legacy when not-wpautop and there is HTML that is not liable to be mutated.' );
}
// Check text examples that will migrate to TinyMCE, where elements and attributes are not in whitelist.
// Check text examples that will migrate to TinyMCE, where elements and attributes are not in the allowed list.
$migratable_text_examples = array(
'Check out <a href="http://example.com">Example</a>',
'<img src="http://example.com/img.jpg" alt="Img">',