list_cats

Filters a taxonomy drop-down display element.

Description

apply_filters( 'list_cats', (string) $r_show_option_none ); 

A variety of taxonomy drop-down display elements can be modified just prior to display via this filter. Filterable arguments include 'show_option_none', show_option_all,, and various forms of the term name.

Parameters (1)

0. $r_show_option_none (string)
Taxonomy element to list.

Usage

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

Defined (6)

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

/wp-includes/category-template.php  
  1. $show_option_none = apply_filters( 'list_cats', $r['show_option_none'] ); 
  1. $show_option_all = apply_filters( 'list_cats', $r['show_option_all'] ); 
  1. $show_option_none = apply_filters( 'list_cats', $r['show_option_none'] ); 
/wp-includes/class-walker-category-dropdown.php  
  1. $cat_name = apply_filters( 'list_cats', $category->name, $category ); 
/wp-includes/class-walker-category.php  
  1. $cat_name = apply_filters( 
/wp-includes/default-filters.php  
  1. add_filter( 'list_cats', 'wptexturize' );