From c9b4885dc87fa9f6a52b4e8b7d5d303e82de56f9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 4 Jul 2020 20:40:21 +0000 Subject: [PATCH] Docs: Correct spelling of "backward compatibility" per the Core Contributor Handbook glossary. Follow-up to [45232]. See #49572. git-svn-id: https://develop.svn.wordpress.org/trunk@48302 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/admin/post.js | 2 +- src/wp-admin/includes/privacy-tools.php | 2 +- src/wp-includes/rest-api.php | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/js/_enqueues/admin/post.js b/src/js/_enqueues/admin/post.js index 991c6fd0a9..00f80c51bb 100644 --- a/src/js/_enqueues/admin/post.js +++ b/src/js/_enqueues/admin/post.js @@ -8,7 +8,7 @@ /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply, commentsBox */ /* global WPSetThumbnailHTML, wptitlehint */ -// Backwards compatibility: prevent fatal errors. +// Backward compatibility: prevent fatal errors. window.makeSlugeditClickable = window.editPermalink = function(){}; // Make sure the wp object exists. diff --git a/src/wp-admin/includes/privacy-tools.php b/src/wp-admin/includes/privacy-tools.php index ad8dd690e2..1edbcae495 100644 --- a/src/wp-admin/includes/privacy-tools.php +++ b/src/wp-admin/includes/privacy-tools.php @@ -473,7 +473,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { // This postmeta is used from version 5.4. $archive_filename = get_post_meta( $request_id, '_export_file_name', true ); - // These are used for backwards compatibility. + // These are used for backward compatibility. $archive_url = get_post_meta( $request_id, '_export_file_url', true ); $archive_pathname = get_post_meta( $request_id, '_export_file_path', true ); diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index 72475fcd3d..ebdcb60a79 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -1464,9 +1464,11 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) { } } - // The "format" keyword should only be applied to strings. However, for backwards compatibility, + // The "format" keyword should only be applied to strings. However, for backward compatibility, // we allow the "format" keyword if the type keyword was not specified, or was set to an invalid value. - if ( isset( $args['format'] ) && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) ) ) { + if ( isset( $args['format'] ) + && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) ) + ) { switch ( $args['format'] ) { case 'hex-color': if ( ! rest_parse_hex_color( $value ) ) { @@ -1652,7 +1654,9 @@ function rest_sanitize_value_from_schema( $value, $args ) { } // This behavior matches rest_validate_value_from_schema(). - if ( isset( $args['format'] ) && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) ) ) { + if ( isset( $args['format'] ) + && ( ! isset( $args['type'] ) || 'string' === $args['type'] || ! in_array( $args['type'], $allowed_types, true ) ) + ) { switch ( $args['format'] ) { case 'hex-color': return (string) sanitize_hex_color( $value );