translations_api_result хук-фильтрWP 4.0.0

Filters the Translation Installation API response results.

Использование

add_filter( 'translations_api_result', 'wp_kama_translations_api_result_filter', 10, 3 );

/**
 * Function for `translations_api_result` filter-hook.
 * 
 * @param array|WP_Error $res  On success an associative array of translations, WP_Error on failure.
 * @param string         $type The type of translations being requested.
 * @param object         $args Translation API arguments.
 *
 * @return array|WP_Error
 */
function wp_kama_translations_api_result_filter( $res, $type, $args ){

	// filter...
	return $res;
}
$res(массив|WP_Error)

On success an associative array of translations, WP_Error on failure.

  • translations(массив)
    List of translations, each an array of data.

    • ...$0(массив)

      • language(строка)
        Language code.

      • version(строка)
        WordPress version.

      • updated(строка)
        Date the translation was last updated, in MySQL datetime format.

      • english_name(строка)
        English name of the language.

      • native_name(строка)
        Native name of the language.

      • package(строка)
        URL to download the translation package.

      • iso(string[])
        Array of ISO language codes.

      • strings(массив)
        Array of translated strings used in the installation process.
$type(строка)
The type of translations being requested.
$args(объект)
Translation API arguments.

Список изменений

С версии 4.0.0 Введена.

Где вызывается хук

translations_api()
translations_api_result
wp-admin/includes/translation-install.php 141
return apply_filters( 'translations_api_result', $res, $type, $args );

Где используется хук в WordPress

Использование не найдено.