term_name

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

Description

apply_filters( 'term_name', (string) $pad_tag_name, (WP_Term) $tag ); 

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

Parameters (2)

0. $pad_tag_name (string)
The term name, padded if not top-level.
1. $tag (WP_Term)
Term object.

Usage

To run the hook, copy the example below.
  1. $pad_tag_name = apply_filters( 'term_name', $pad_tag_name, $tag ); 
  2.  
  3. if ( !empty( $pad_tag_name ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the term_name callback 
  2. function filter_term_name( $pad_tag_name, $tag ) { 
  3. // make filter magic happen here... 
  4. return $pad_tag_name
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'term_name', 'filter_term_name', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'term_name', 'filter_term_name', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

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