term_name хук-фильтрWP 2.5.0

Filters display of the term name in the terms list table.

The default output may include padding due to the term's current level in the term hierarchy.

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

add_filter( 'term_name', 'wp_kama_term_name_filter', 10, 2 );

/**
 * Function for `term_name` filter-hook.
 * 
 * @param string  $pad_tag_name The term name, padded if not top-level.
 * @param WP_Term $tag          Term object.
 *
 * @return string
 */
function wp_kama_term_name_filter( $pad_tag_name, $tag ){

	// filter...
	return $pad_tag_name;
}
$pad_tag_name(строка)
The term name, padded if not top-level.
$tag(WP_Term)
Term object.

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

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

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

WP_Terms_List_Table::column_name()
term_name
wp-admin/includes/class-wp-terms-list-table.php 394
$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );

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

wp-includes/default-filters.php 147
add_filter( $filter, 'wptexturize' );
wp-includes/default-filters.php 148
add_filter( $filter, 'convert_chars' );
wp-includes/default-filters.php 149
add_filter( $filter, 'esc_html' );
wp-includes/default-filters.php 31
add_filter( $filter, 'sanitize_text_field' );
wp-includes/default-filters.php 32
add_filter( $filter, 'wp_kses_data' );
wp-includes/default-filters.php 34
add_filter( $filter, '_wp_specialchars', 30 );