the_category
This filter is documented in wp-includes/category-template.php.
Description
Parameters (3)
- 0. $var (string) =>
''
- The var.
- 1. $separator (unknown)
- The separator.
- 2. $parents (unknown)
- The parents.
Usage
- To run the hook, copy the example below.
- $var = apply_filters( 'the_category', $var, $separator, $parents );
- if ( !empty( $var ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the the_category callback
- function filter_the_category( $var, $separator, $parents ) {
- // make filter magic happen here...
- return $var;
- };
- // add the filter
- add_filter( 'the_category', 'filter_the_category', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'the_category', 'filter_the_category', 10, 3 );
Defined (8)
The filter is defined in the following location(s).
- /wp-includes/category-template.php
- return apply_filters( 'the_category', '', $separator, $parents );
- return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
- return apply_filters( 'the_category', $thelist, $separator, $parents );
- /wp-admin/includes/template.php
- echo esc_html( apply_filters( 'the_category', $term->name ) );
- $name = esc_html( apply_filters( 'the_category', $category->name ) );
- /wp-admin/includes/class-walker-category-checklist.php
- esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
- esc_html( apply_filters( 'the_category', $category->name ) ) . '</label>';
- /wp-admin/edit-tags.php
- '<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category') ) ) . '</strong>'