the_category

the_category

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('the_category') is found 8 times:

  • /wp-admin/edit-tags.php line 630

    printf(
    /* translators: %s: Default category. */
    __( ‘Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the default category %s. The default category cannot be deleted.’ ),
    /** This filter is documented in wp-includes/category-template.php */
    ‘ . apply_filters( ‘the_category’, get_cat_name( get_option( ‘default_category’ ) ), ”, ” ) . ‘
    );
    ?>

  • /wp-admin/includes/class-walker-category-checklist.php line 108
    			$output .= "\n" . '<li' . $class . '>' .
    				'<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
    				' tabindex="0" role="checkbox" aria-checked="' . $aria_checked . '">' .
    				/** This filter is documented in wp-includes/category-template.php */
    				esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</div>';
    		} else {
    			$is_selected = in_array( $category->term_id, $args['selected_cats'], true );
    			$is_disabled = ! empty( $args['disabled'] );
    
    			$output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" .
    				'<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' .
    
  • /wp-admin/includes/class-walker-category-checklist.php line 118
    				'<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="in-' . $taxonomy . '-' . $category->term_id . '"' .
    				checked( $is_selected, true, false ) .
    				disabled( $is_disabled, true, false ) . ' /> ' .
    				/** This filter is documented in wp-includes/category-template.php */
    				esc_html( apply_filters( 'the_category', $category->name, '', '' ) ) . '</label>';
    		}
    	}
    
    	/**
    	 * Ends the element output, if needed.
    	 *
    
  • /wp-admin/includes/template.php line 250

    Share this:

  • /wp-admin/includes/template.php line 298
    	foreach ( $categories as $category ) {
    		$cat_id = $category->term_id;
    
    		/** This filter is documented in wp-includes/category-template.php */
    		$name    = esc_html( apply_filters( 'the_category', $category->name, '', '' ) );
    		$checked = in_array( $cat_id, $checked_categories, true ) ? ' checked="checked"' : '';
    		echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category&#91;&#93;" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, '</label></li>';
    	}
    }
    
    /**
    
  • /wp-includes/category-template.php line 146
    	global $wp_rewrite;
    
    	if ( ! is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) {
    		/** This filter is documented in wp-includes/category-template.php */
    		return apply_filters( 'the_category', '', $separator, $parents );
    	}
    
    	/**
    	 * Filters the categories before building the category list.
    	 *
    	 * @since 4.4.0
    
  • /wp-includes/category-template.php line 162
    	$categories = apply_filters( 'the_category_list', get_the_category( $post_id ), $post_id );
    
    	if ( empty( $categories ) ) {
    		/** This filter is documented in wp-includes/category-template.php */
    		return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents );
    	}
    
    	$rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';
    
    	$thelist = '';
    	if ( '' === $separator ) {
    
  • /wp-includes/category-template.php line 230
    	 * @param string $separator Separator used between the categories.
    	 * @param string $parents   How to display the category parents. Accepts 'multiple',
    	 *                          'single', or empty.
    	 */
    	return apply_filters( 'the_category', $thelist, $separator, $parents );
    }
    
    /**
     * Checks if the current post is within any of the given categories.
     *
     * The given categories are checked against the post's categories' term_ids, names and slugs.