term_name
Filters display of the term name in the terms list table.
Description
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.
- $pad_tag_name = apply_filters( 'term_name', $pad_tag_name, $tag );
- if ( !empty( $pad_tag_name ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the term_name callback
- function filter_term_name( $pad_tag_name, $tag ) {
- // make filter magic happen here...
- return $pad_tag_name;
- };
- // add the filter
- add_filter( 'term_name', 'filter_term_name', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );