diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 3953b74392..64ceac73df 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -23,16 +23,16 @@ define( 'REST_API_VERSION', '2.0' ); * @since 5.1.0 Added a `_doing_it_wrong()` notice when not called on or after the `rest_api_init` hook. * @since 5.5.0 Added a `_doing_it_wrong()` notice when the required `permission_callback` argument is not set. * - * @param string $namespace The first URL segment after core prefix. Should be unique to your package/plugin. - * @param string $route The base URL for route you are adding. - * @param array $args Optional. Either an array of options for the endpoint, or an array of arrays for - * multiple methods. Default empty array. - * @param bool $override Optional. If the route already exists, should we override it? True overrides, - * false merges (with newer overriding if duplicate keys exist). Default false. + * @param string $route_namespace The first URL segment after core prefix. Should be unique to your package/plugin. + * @param string $route The base URL for route you are adding. + * @param array $args Optional. Either an array of options for the endpoint, or an array of arrays for + * multiple methods. Default empty array. + * @param bool $override Optional. If the route already exists, should we override it? True overrides, + * false merges (with newer overriding if duplicate keys exist). Default false. * @return bool True on success, false on error. */ -function register_rest_route( $namespace, $route, $args = array(), $override = false ) { - if ( empty( $namespace ) ) { +function register_rest_route( $route_namespace, $route, $args = array(), $override = false ) { + if ( empty( $route_namespace ) ) { /* * Non-namespaced routes are not allowed, with the exception of the main * and namespace indexes. If you really need to register a @@ -45,9 +45,9 @@ function register_rest_route( $namespace, $route, $args = array(), $override = f return false; } - $clean_namespace = trim( $namespace, '/' ); + $clean_namespace = trim( $route_namespace, '/' ); - if ( $clean_namespace !== $namespace ) { + if ( $clean_namespace !== $route_namespace ) { _doing_it_wrong( __FUNCTION__, __( 'Namespace must not start or end with a slash.' ), '5.4.2' ); } @@ -642,20 +642,20 @@ function rest_ensure_response( $response ) { * * @since 4.4.0 * - * @param string $function The function that was called. - * @param string $replacement The function that should have been called. - * @param string $version Version. + * @param string $function_name The function that was called. + * @param string $replacement The function that should have been called. + * @param string $version Version. */ -function rest_handle_deprecated_function( $function, $replacement, $version ) { +function rest_handle_deprecated_function( $function_name, $replacement, $version ) { if ( ! WP_DEBUG || headers_sent() ) { return; } if ( ! empty( $replacement ) ) { /* translators: 1: Function name, 2: WordPress version number, 3: New function name. */ - $string = sprintf( __( '%1$s (since %2$s; use %3$s instead)' ), $function, $version, $replacement ); + $string = sprintf( __( '%1$s (since %2$s; use %3$s instead)' ), $function_name, $version, $replacement ); } else { /* translators: 1: Function name, 2: WordPress version number. */ - $string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version ); + $string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function_name, $version ); } header( sprintf( 'X-WP-DeprecatedFunction: %s', $string ) ); @@ -666,20 +666,20 @@ function rest_handle_deprecated_function( $function, $replacement, $version ) { * * @since 4.4.0 * - * @param string $function The function that was called. - * @param string $message A message regarding the change. - * @param string $version Version. + * @param string $function_name The function that was called. + * @param string $message A message regarding the change. + * @param string $version Version. */ -function rest_handle_deprecated_argument( $function, $message, $version ) { +function rest_handle_deprecated_argument( $function_name, $message, $version ) { if ( ! WP_DEBUG || headers_sent() ) { return; } if ( $message ) { /* translators: 1: Function name, 2: WordPress version number, 3: Error message. */ - $string = sprintf( __( '%1$s (since %2$s; %3$s)' ), $function, $version, $message ); + $string = sprintf( __( '%1$s (since %2$s; %3$s)' ), $function_name, $version, $message ); } else { /* translators: 1: Function name, 2: WordPress version number. */ - $string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version ); + $string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function_name, $version ); } header( sprintf( 'X-WP-DeprecatedParam: %s', $string ) ); @@ -690,11 +690,11 @@ function rest_handle_deprecated_argument( $function, $message, $version ) { * * @since 5.5.0 * - * @param string $function The function that was called. - * @param string $message A message explaining what has been done incorrectly. - * @param string|null $version The version of WordPress where the message was added. + * @param string $function_name The function that was called. + * @param string $message A message explaining what has been done incorrectly. + * @param string|null $version The version of WordPress where the message was added. */ -function rest_handle_doing_it_wrong( $function, $message, $version ) { +function rest_handle_doing_it_wrong( $function_name, $message, $version ) { if ( ! WP_DEBUG || headers_sent() ) { return; } @@ -702,11 +702,11 @@ function rest_handle_doing_it_wrong( $function, $message, $version ) { if ( $version ) { /* translators: Developer debugging message. 1: PHP function name, 2: WordPress version number, 3: Explanatory message. */ $string = __( '%1$s (since %2$s; %3$s)' ); - $string = sprintf( $string, $function, $version, $message ); + $string = sprintf( $string, $function_name, $version, $message ); } else { /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message. */ $string = __( '%1$s (%2$s)' ); - $string = sprintf( $string, $function, $message ); + $string = sprintf( $string, $function_name, $message ); } header( sprintf( 'X-WP-DoingItWrong: %s', $string ) ); @@ -1656,13 +1656,13 @@ function rest_handle_multi_type_schema( $value, $args, $param = '' ) { * * @since 5.5.0 * - * @param array $array The array to check. + * @param array $input_array The array to check. * @return bool True if the array contains unique items, false otherwise. */ -function rest_validate_array_contains_unique_items( $array ) { +function rest_validate_array_contains_unique_items( $input_array ) { $seen = array(); - foreach ( $array as $item ) { + foreach ( $input_array as $item ) { $stabilized = rest_stabilize_value( $item ); $key = serialize( $stabilized ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 14304a382f..db052b808d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-54963'; +$wp_version = '6.2-alpha-54964'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.