Filter hook 'term_name'

in WP Core File wp-admin/includes/class-wp-terms-list-table.php at line 401

View Source

term_name

Filter Hook
Description
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.

Hook Information

File Location wp-admin/includes/class-wp-terms-list-table.php View on GitHub
Hook Type Filter
Line Number 401

Hook Parameters

Type Name Description
string $pad_tag_name The term name, padded if not top-level.
WP_Term $tag Term object.

Usage Examples

Basic Usage
<?php
// Hook into term_name
add_filter('term_name', 'my_custom_filter', 10, 2);

function my_custom_filter($pad_tag_name, $tag) {
    // Your custom filtering logic here
    return $pad_tag_name;
}

Source Code Context

wp-admin/includes/class-wp-terms-list-table.php:401 - How this hook is used in WordPress core
<?php
 396  		 * @see WP_Terms_List_Table::column_name()
 397  		 *
 398  		 * @param string $pad_tag_name The term name, padded if not top-level.
 399  		 * @param WP_Term $tag         Term object.
 400  		 */
 401  		$name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
 402  
 403  		$qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
 404  
 405  		$uri = wp_doing_ajax() ? wp_get_referer() : $_SERVER['REQUEST_URI'];
 406  

PHP Documentation

<?php
/**
		 * 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.
		 *
		 * @since 2.5.0
		 *
		 * @see WP_Terms_List_Table::column_name()
		 *
		 * @param string $pad_tag_name The term name, padded if not top-level.
		 * @param WP_Term $tag         Term object.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/class-wp-terms-list-table.php
Related Hooks

Related hooks will be displayed here in future updates.