translations_api_result filter-hookWP 4.0.0

Filters the Translation Installation API response results.

Usage

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  Response as an associative array or WP_Error.
 * @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(array|WP_Error)
Response as an associative array or WP_Error.
$type(string)
The type of translations being requested.
$args(object)
Translation API arguments.

Changelog

Since 4.0.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.