Ticket #8446: 8446.patch

File 8446.patch, 906 bytes (added by hakre, 3 years ago)

taking numerical values instead not-working slug values.

  • wp-includes/post-template.php

     
    311311        $post = get_post($post_id); 
    312312 
    313313        $classes = array(); 
    314  
     314         
     315        $classes[] = 'post-' . $post->ID; 
    315316        $classes[] = $post->post_type; 
    316317 
    317318        // sticky for Sticky Posts 
     
    323324 
    324325        // Categories 
    325326        foreach ( (array) get_the_category($post->ID) as $cat ) { 
    326                 if ( empty($cat->slug ) ) 
     327                if ( empty($cat->cat_ID ) ) 
    327328                        continue; 
    328                 $classes[] = 'category-' . $cat->slug; 
     329                $classes[] = 'category-' . $cat->cat_ID; 
    329330        } 
    330331 
    331332        // Tags 
    332333        foreach ( (array) get_the_tags($post->ID) as $tag ) { 
    333                 if ( empty($tag->slug ) ) 
     334                if ( empty($tag->term_id ) ) 
    334335                        continue; 
    335                 $classes[] = 'tag-' . $tag->slug; 
     336                $classes[] = 'tag-' . $tag->term_id; 
    336337        } 
    337338 
    338339        if ( !empty($class) ) {