wppaste
WordPress

apply_filters( 'translations_api_result', array|WP_Error $res, string $type, object $args )

Since
4.0.0
Filters the Translation Installation API response results.

Compatibility

WordPress
since 4.0.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$resarray|WP_Error
{ On success an associative array of translations, WP_Error on failure.
@type array $translations { List of translations, each an array of data.
@type array ...$0 { @type string $language Language code.
@type string $version WordPress version.
@type string $updated Date the translation was last updated, in MySQL datetime format.
@type string $english_name English name of the language.
@type string $native_name Native name of the language.
@type string $package URL to download the translation package.
@type string[] $iso Array of ISO language codes.
@type array $strings Array of translated strings used in the installation process.
} } }
  • $translationsarray

    List of translations, each an array of data.
    • ...$0array

      @type string $language Language code.
      • $versionstring

        WordPress version.
      • $updatedstring

        Date the translation was last updated, in MySQL datetime format.
      • $english_namestring

        English name of the language.
      • $native_namestring

        Native name of the language.
      • $packagestring

        URL to download the translation package.
      • $isostring[]

        Array of ISO language codes.
      • $stringsarray

        Array of translated strings used in the installation process. }
$typestring
The type of translations being requested.
$argsobject
Translation API arguments.

Where this hook fires · 1

  • wp-admin/includes/translation-install.php:141translations_api()

Source code

	 *         }	 *     }	 * }	 * @param string         $type The type of translations being requested.	 * @param object         $args Translation API arguments.	 */	return apply_filters( 'translations_api_result', $res, $type, $args );} /** * Get available translations from the WordPress.org API. * * @since 4.0.0

Changelog

Introduced in 4.0.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.