Make WordPress Core

Changeset 52645


Ignore:
Timestamp:
01/27/2022 09:13:09 PM (less than one hour ago)
Author:
audrasjb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/translation-install.php

    r49927 r52645  
    1515 * @param string       $type Type of translations. Accepts 'plugins', 'themes', 'core'.
    1616 * @param array|object $args Translation API arguments. Optional.
    17  * @return object|WP_Error On success an object of translations, WP_Error on failure.
     17 * @return array|WP_Error On success an associative array of translations, WP_Error on failure.
    1818 */
    1919function translations_api( $type, $args = null ) {
     
    3030     * @since 4.0.0
    3131     *
    32      * @param false|object $result The result object. Default false.
    33      * @param string       $type   The type of translations being requested.
    34      * @param object       $args   Translation API arguments.
     32     * @param false|array $result The result array. Default false.
     33     * @param string      $type   The type of translations being requested.
     34     * @param object      $args   Translation API arguments.
    3535     */
    3636    $res = apply_filters( 'translations_api', false, $type, $args );
     
    103103     * @since 4.0.0
    104104     *
    105      * @param object|WP_Error $res  Response object or WP_Error.
    106      * @param string          $type The type of translations being requested.
    107      * @param object          $args Translation API arguments.
     105     * @param array|WP_Error $res  Response as an associative array or WP_Error.
     106     * @param string         $type The type of translations being requested.
     107     * @param object         $args Translation API arguments.
    108108     */
    109109    return apply_filters( 'translations_api_result', $res, $type, $args );
Note: See TracChangeset for help on using the changeset viewer.