the_category

the_category

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

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('the_category') is found 8 times:

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

    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
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
        $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'] );
        $li_element_id       = wp_unique_prefixed_id( "in-{$taxonomy}-{$category->term_id}-" );
        $checkbox_element_id = wp_unique_prefixed_id( "in-{$taxonomy}-{$category->term_id}-" );
  • /wp-admin/includes/class-walker-category-checklist.php line 120
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
                '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="' . $name . '[]" id="' . esc_attr( $checkbox_element_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
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
        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
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    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
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    $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
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
         * @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.