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.
} } }$translationsarrayList of translations, each an array of data....$0array@type string $language Language code.$versionstringWordPress version.$updatedstringDate the translation was last updated, in MySQL datetime format.$english_namestringEnglish name of the language.$native_namestringNative name of the language.$packagestringURL to download the translation package.$isostring[]Array of ISO language codes.$stringsarrayArray 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.0Changelog
Introduced in 4.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 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.