WordPress.org

Make WordPress Core

Ticket #22271: 22271.diff

File 22271.diff, 821 bytes (added by scribu, 2 years ago)

Always returns the original $class

  • wp-includes/post-template.php

    diff --git wp-includes/post-template.php wp-includes/post-template.php
    index a8e4f89..6a26d80 100644
    function get_post_class( $class = '', $post_id = null ) { 
    318318 
    319319        $classes = array(); 
    320320 
     321        if ( !empty($class) ) { 
     322                if ( !is_array( $class ) ) 
     323                        $class = preg_split('#\s+#', $class); 
     324                $classes = array_merge($classes, $class); 
     325        } 
     326 
    321327        if ( empty($post) ) 
    322328                return $classes; 
    323329 
    function get_post_class( $class = '', $post_id = null ) { 
    366372                } 
    367373        } 
    368374 
    369         if ( !empty($class) ) { 
    370                 if ( !is_array( $class ) ) 
    371                         $class = preg_split('#\s+#', $class); 
    372                 $classes = array_merge($classes, $class); 
    373         } 
    374  
    375375        $classes = array_map('esc_attr', $classes); 
    376376 
    377377        return apply_filters('post_class', $classes, $class, $post->ID);