get_tags хук-фильтрWP 2.3.0

Filters the array of term objects returned for the 'post_tag' taxonomy.

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

add_filter( 'get_tags', 'wp_kama_get_tags_filter', 10, 2 );

/**
 * Function for `get_tags` filter-hook.
 * 
 * @param WP_Term[]|int|WP_Error $tags Array of 'post_tag' term objects, a count thereof, or WP_Error if any of the taxonomies do not exist.
 * @param array                  $args An array of arguments. See {@see get_terms()}.
 *
 * @return WP_Term[]|int|WP_Error
 */
function wp_kama_get_tags_filter( $tags, $args ){

	// filter...
	return $tags;
}
$tags(WP_Term[]|int|WP_Error)
Array of 'post_tag' term objects, a count thereof, or WP_Error if any of the taxonomies do not exist.
$args(массив)
An array of arguments. See {@see get_terms()}.

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

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

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

get_tags()
get_tags
wp-includes/category.php 312
$tags = apply_filters( 'get_tags', $tags, $args );

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

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