the_category

This filter is documented in wp-includes/category-template.php.

Description

apply_filters( 'the_category', (string) $get_cat_name ); 

Parameters (1)

0. $get_cat_name (string) => get_cat_name( get_option( 'default_category') )
The get cat name.

Usage

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

Defined (8)

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

/wp-admin/edit-tags.php  
  1. '<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) . '</strong>' 
/wp-admin/includes/class-walker-category-checklist.php  
  1. esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>'; 
  1. esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>'; 
/wp-admin/includes/template.php  
  1. echo esc_html( apply_filters( 'the_category', $term->name ) ); 
  1. $name = esc_html( apply_filters( 'the_category', $category->name ) ); 
/wp-includes/category-template.php  
  1. return apply_filters( 'the_category', '', $separator, $parents ); 
  1. return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents ); 
  1. return apply_filters( 'the_category', $thelist, $separator, $parents );