WordPress.org

Make WordPress Core

Ticket #9227: get_the_category_display.patch

File get_the_category_display.patch, 577 bytes (added by KevinB, 6 years ago)

direct filtering of the post categories array in get_the_category list

  • category-template.php

     
    209209 */ 
    210210function get_the_category_list( $separator = '', $parents='', $post_id = false ) { 
    211211        global $wp_rewrite; 
    212         $categories = get_the_category( $post_id ); 
     212        $categories = apply_filters( 'get_the_category', get_the_category( $post_id ), 'display' ); 
    213213        if ( empty( $categories ) ) 
    214214                return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents ); 
    215215