From b3d3adaa2bc4498cad82bd6ebb18eec14d94a82a Mon Sep 17 00:00:00 2001 From: audrasjb Date: Thu, 27 Jan 2022 21:15:03 +0000 Subject: [PATCH] Docs: Fix incorrect type in `translations_api` and `translations_api_result` docblocks. Before this changeset, `translation_api` and `translation_api_result` filters were incorrectly marked as taking object as their first argument. The correct type is an array as `json_decode()` is asked to return an associative array. Props volodymyrkolesnykov. Fixes #54959. Built from https://develop.svn.wordpress.org/trunk@52645 git-svn-id: http://core.svn.wordpress.org/trunk@52234 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/translation-install.php | 14 +++++++------- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/translation-install.php b/wp-admin/includes/translation-install.php index 74681fb314..dc7cb89a05 100644 --- a/wp-admin/includes/translation-install.php +++ b/wp-admin/includes/translation-install.php @@ -14,7 +14,7 @@ * * @param string $type Type of translations. Accepts 'plugins', 'themes', 'core'. * @param array|object $args Translation API arguments. Optional. - * @return object|WP_Error On success an object of translations, WP_Error on failure. + * @return array|WP_Error On success an associative array of translations, WP_Error on failure. */ function translations_api( $type, $args = null ) { // Include an unmodified $wp_version. @@ -29,9 +29,9 @@ function translations_api( $type, $args = null ) { * * @since 4.0.0 * - * @param false|object $result The result object. Default false. - * @param string $type The type of translations being requested. - * @param object $args Translation API arguments. + * @param false|array $result The result array. Default false. + * @param string $type The type of translations being requested. + * @param object $args Translation API arguments. */ $res = apply_filters( 'translations_api', false, $type, $args ); @@ -102,9 +102,9 @@ function translations_api( $type, $args = null ) { * * @since 4.0.0 * - * @param object|WP_Error $res Response object or WP_Error. - * @param string $type The type of translations being requested. - * @param object $args Translation API arguments. + * @param array|WP_Error $res Response as an associative array or WP_Error. + * @param string $type The type of translations being requested. + * @param object $args Translation API arguments. */ return apply_filters( 'translations_api_result', $res, $type, $args ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 16e86aef9a..0191ac3057 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52644'; +$wp_version = '6.0-alpha-52645'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.