From 3adb24ff8ce5d69253905dd85048423d7e3c46ca Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Fri, 21 Oct 2022 21:10:29 +0000 Subject: [PATCH] Docs: Align spelling with American English. This changeset replaces "behaviour" with "behavior" in various docblocks. Props kebbet, jrf. See #56811, #56792. git-svn-id: https://develop.svn.wordpress.org/trunk@54663 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-blocks.php | 2 +- src/wp-admin/includes/update-core.php | 2 +- src/wp-includes/class-wp-http-proxy.php | 4 ++-- src/wp-includes/class-wp-http.php | 6 +++--- src/wp-includes/deprecated.php | 2 +- src/wp-includes/formatting.php | 8 ++++---- src/wp-includes/functions.php | 2 +- src/wp-includes/rest-api.php | 2 +- src/wp-includes/rest-api/class-wp-rest-request.php | 2 +- src/wp-includes/rest-api/class-wp-rest-server.php | 2 +- tests/phpunit/tests/admin/wpPostsListTable.php | 2 +- tests/phpunit/tests/functions/cleanDirsizeCache.php | 4 ++-- tests/phpunit/tests/functions/wpListUtil.php | 2 +- .../rest-api/rest-application-passwords-controller.php | 4 ++-- tests/phpunit/tests/theme.php | 2 +- tests/phpunit/wp-mail-real-test.php | 2 +- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 8b07908d61..f43c835168 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -271,7 +271,7 @@ wp_enqueue_style( 'wp-edit-post' ); */ do_action( 'enqueue_block_editor_assets' ); -// In order to duplicate classic meta box behaviour, we need to run the classic meta box actions. +// In order to duplicate classic meta box behavior, we need to run the classic meta box actions. require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; register_and_do_post_meta_boxes( $post ); diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index ec54ff7ae0..be7a608286 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -852,7 +852,7 @@ $_old_files = array( * * The contents of this array indicate any new bundled plugins/themes which * should be installed with the WordPress Upgrade. These items will not be - * re-installed in future upgrades, this behaviour is controlled by the + * re-installed in future upgrades, this behavior is controlled by the * introduced version present here being older than the current installed version. * * The content of this array should follow the following format: diff --git a/src/wp-includes/class-wp-http-proxy.php b/src/wp-includes/class-wp-http-proxy.php index 3e3d1f684e..0bc265862a 100644 --- a/src/wp-includes/class-wp-http-proxy.php +++ b/src/wp-includes/class-wp-http-proxy.php @@ -45,7 +45,7 @@ class WP_HTTP_Proxy { /** * Whether proxy connection should be used. * - * Constants which control this behaviour: + * Constants which control this behavior: * * - `WP_PROXY_HOST` * - `WP_PROXY_PORT` @@ -61,7 +61,7 @@ class WP_HTTP_Proxy { /** * Whether authentication should be used. * - * Constants which control this behaviour: + * Constants which control this behavior: * * - `WP_PROXY_USERNAME` * - `WP_PROXY_PASSWORD` diff --git a/src/wp-includes/class-wp-http.php b/src/wp-includes/class-wp-http.php index e96713e718..3d4e8798aa 100644 --- a/src/wp-includes/class-wp-http.php +++ b/src/wp-includes/class-wp-http.php @@ -247,7 +247,7 @@ class WP_Http { * - A WP_Error instance * - boolean false to avoid short-circuiting the response * - * Returning any other value may result in unexpected behaviour. + * Returning any other value may result in unexpected behavior. * * @since 2.9.0 * @@ -325,7 +325,7 @@ class WP_Http { 'hooks' => new WP_HTTP_Requests_Hooks( $url, $parsed_args ), ); - // Ensure redirects follow browser behaviour. + // Ensure redirects follow browser behavior. $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) ); // Validate redirected URLs. @@ -476,7 +476,7 @@ class WP_Http { } /** - * Match redirect behaviour to browser handling. + * Match redirect behavior to browser handling. * * Changes 302 redirects from POST to GET to match browser handling. Per * RFC 7231, user agents can deviate from the strict reading of the diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php index 9705c98b1d..8f41b13038 100644 --- a/src/wp-includes/deprecated.php +++ b/src/wp-includes/deprecated.php @@ -2027,7 +2027,7 @@ function get_link( $bookmark_id, $output = OBJECT, $filter = 'raw' ) { * Checks and cleans a URL. * * A number of characters are removed from the URL. If the URL is for displaying - * (the default behaviour) ampersands are also replaced. The 'clean_url' filter + * (the default behavior) ampersands are also replaced. The 'clean_url' filter * is applied to the returned cleaned URL. * * @since 1.2.0 diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 6f34538eef..a8780b9c2a 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -943,7 +943,7 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals return $string; } - // Account for the previous behaviour of the function when the $quote_style is not an accepted value. + // Account for the previous behavior of the function when the $quote_style is not an accepted value. if ( empty( $quote_style ) ) { $quote_style = ENT_NOQUOTES; } elseif ( ENT_XML1 === $quote_style ) { @@ -1023,7 +1023,7 @@ function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) { return $string; } - // Match the previous behaviour of _wp_specialchars() when the $quote_style is not an accepted value. + // Match the previous behavior of _wp_specialchars() when the $quote_style is not an accepted value. if ( empty( $quote_style ) ) { $quote_style = ENT_NOQUOTES; } elseif ( ! in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) { @@ -4334,7 +4334,7 @@ function _deep_replace( $search, $subject ) { * is preparing an array for use in an IN clause. * * NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string, - * this prevents certain SQLi attacks from taking place. This change in behaviour + * this prevents certain SQLi attacks from taking place. This change in behavior * may cause issues for code that expects the return value of esc_sql() to be useable * for other purposes. * @@ -4354,7 +4354,7 @@ function esc_sql( $data ) { * Checks and cleans a URL. * * A number of characters are removed from the URL. If the URL is for displaying - * (the default behaviour) ampersands are also replaced. The {@see 'clean_url'} filter + * (the default behavior) ampersands are also replaced. The {@see 'clean_url'} filter * is applied to the returned cleaned URL. * * @since 2.8.0 diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index c303f0d4a6..edbf5e5c20 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -8436,7 +8436,7 @@ function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { /** * Sorts the keys of an array alphabetically. * The array is passed by reference so it doesn't get returned - * which mimics the behaviour of ksort. + * which mimics the behavior of ksort. * * @since 6.0.0 * diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index 1d6b8a7e68..b611745ebd 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -3307,7 +3307,7 @@ function rest_get_endpoint_args_for_schema( $schema, $method = WP_REST_Server::C * Converts an error to a response object. * * This iterates over all error codes and messages to change it into a flat - * array. This enables simpler client behaviour, as it is represented as a + * array. This enables simpler client behavior, as it is represented as a * list in JSON rather than an object/map. * * @since 5.7.0 diff --git a/src/wp-includes/rest-api/class-wp-rest-request.php b/src/wp-includes/rest-api/class-wp-rest-request.php index b93bd36857..494abd2360 100644 --- a/src/wp-includes/rest-api/class-wp-rest-request.php +++ b/src/wp-includes/rest-api/class-wp-rest-request.php @@ -14,7 +14,7 @@ * * Note: This implements ArrayAccess, and acts as an array of parameters when * used in that manner. It does not use ArrayObject (as we cannot rely on SPL), - * so be aware it may have non-array behaviour in some cases. + * so be aware it may have non-array behavior in some cases. * * Note: When using features provided by ArrayAccess, be aware that WordPress deliberately * does not distinguish between arguments of the same name for different request methods. diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php index 6327d5a539..1690a00eb8 100644 --- a/src/wp-includes/rest-api/class-wp-rest-server.php +++ b/src/wp-includes/rest-api/class-wp-rest-server.php @@ -193,7 +193,7 @@ class WP_REST_Server { * Converts an error to a response object. * * This iterates over all error codes and messages to change it into a flat - * array. This enables simpler client behaviour, as it is represented as a + * array. This enables simpler client behavior, as it is represented as a * list in JSON rather than an object/map. * * @since 4.4.0 diff --git a/tests/phpunit/tests/admin/wpPostsListTable.php b/tests/phpunit/tests/admin/wpPostsListTable.php index c209179870..9e19ff3d8a 100644 --- a/tests/phpunit/tests/admin/wpPostsListTable.php +++ b/tests/phpunit/tests/admin/wpPostsListTable.php @@ -225,7 +225,7 @@ class Tests_Admin_wpPostsListTable extends WP_UnitTestCase { $args ); - // Mimic the behaviour of `wp_edit_posts_query()`: + // Mimic the behavior of `wp_edit_posts_query()`: if ( ! isset( $args['orderby'] ) ) { $args['orderby'] = 'menu_order title'; $args['order'] = 'asc'; diff --git a/tests/phpunit/tests/functions/cleanDirsizeCache.php b/tests/phpunit/tests/functions/cleanDirsizeCache.php index e8a247de24..c10dc8b97b 100644 --- a/tests/phpunit/tests/functions/cleanDirsizeCache.php +++ b/tests/phpunit/tests/functions/cleanDirsizeCache.php @@ -105,7 +105,7 @@ class Tests_Functions_CleanDirsizeCache extends WP_UnitTestCase { } /** - * Tests the behaviour of the function when the transient doesn't exist. + * Tests the behavior of the function when the transient doesn't exist. * * @ticket 52241 * @ticket 53635 @@ -121,7 +121,7 @@ class Tests_Functions_CleanDirsizeCache extends WP_UnitTestCase { } /** - * Tests the behaviour of the function when the transient does exist, but is not an array. + * Tests the behavior of the function when the transient does exist, but is not an array. * * In particular, this tests that no PHP TypeErrors are being thrown. * diff --git a/tests/phpunit/tests/functions/wpListUtil.php b/tests/phpunit/tests/functions/wpListUtil.php index df70b52be4..e27831fc56 100644 --- a/tests/phpunit/tests/functions/wpListUtil.php +++ b/tests/phpunit/tests/functions/wpListUtil.php @@ -942,7 +942,7 @@ class Tests_Functions_wpListUtil extends WP_UnitTestCase { /** * Tests non-existent '$orderby' fields. * - * In PHP < 7.0.0, the sorting behaviour is different, which Core does not + * In PHP < 7.0.0, the sorting behavior is different, which Core does not * currently handle. Until this is fixed, or the minimum PHP version is * raised to PHP 7.0.0+, these tests will be skipped on PHP < 7.0.0. * diff --git a/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php b/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php index d4418f62cd..1162c1f733 100644 --- a/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php +++ b/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php @@ -992,7 +992,7 @@ class WP_Test_REST_Application_Passwords_Controller extends WP_Test_REST_Control $actual = wp_is_application_passwords_supported(); - // Revert to default behaviour so that other tests are not affected. + // Revert to default behavior so that other tests are not affected. putenv( 'WP_ENVIRONMENT_TYPE' ); $this->assertTrue( $actual ); @@ -1024,7 +1024,7 @@ class WP_Test_REST_Application_Passwords_Controller extends WP_Test_REST_Control $actual = wp_is_application_passwords_available(); if ( 'default' === $expected ) { - // Revert to default behaviour so that other tests are not affected. + // Revert to default behavior so that other tests are not affected. putenv( 'WP_ENVIRONMENT_TYPE' ); } diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 3e86a8ac6f..378ed16093 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -356,7 +356,7 @@ class Tests_Theme extends WP_UnitTestCase { $this->assertNotFalse( $theme->errors() ); $this->assertFalse( $theme->exists() ); - // These return the bogus name - perhaps not ideal behaviour? + // These return the bogus name - perhaps not ideal behavior? $this->assertSame( $template, get_template() ); $this->assertSame( $style, get_stylesheet() ); } diff --git a/tests/phpunit/wp-mail-real-test.php b/tests/phpunit/wp-mail-real-test.php index 467442249f..243efde046 100644 --- a/tests/phpunit/wp-mail-real-test.php +++ b/tests/phpunit/wp-mail-real-test.php @@ -59,7 +59,7 @@ assert( true === is_blog_installed() ); define( 'PHPUnit_MAIN_METHOD', false ); $original_wpdb = $GLOBALS['wpdb']; -// Hide warnings during testing, since that's the normal WP behaviour. +// Hide warnings during testing, since that's the normal WP behavior. if ( ! WP_DEBUG ) { error_reporting( E_ALL ^ E_NOTICE ); }