WordPress.org

Make WordPress Core

Ticket #18516: 18516.2.diff

File 18516.2.diff, 1.9 KB (added by brandondove, 7 years ago)

New patch based on feedback from nacin

  • wp-includes/post-template.php

     
    327327        $classes[] = $post->post_type;
    328328        $classes[] = 'type-' . $post->post_type;
    329329        $classes[] = 'status-' . $post->post_status;
     330       
     331        // Did you write this or someone else?
     332        $post_owner = ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
     333        $classes[] = 'author-' . $post_owner;
    330334
    331335        // Post Format
    332336        if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
  • wp-admin/includes/class-wp-posts-list-table.php

     
    471471                setup_postdata( $post );
    472472
    473473                $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
    474                 $post_owner = ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
    475474                $edit_link = get_edit_post_link( $post->ID );
    476475                $title = _draft_or_post_title();
    477476                $post_type_object = get_post_type_object( $post->post_type );
    478477                $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
    479                 $post_format = get_post_format( $post->ID );
    480                 $post_format_class = ( $post_format && !is_wp_error($post_format) ) ? 'format-' . sanitize_html_class( $post_format ) : 'format-default';
     478                $the_post_class = join( ' ', get_post_class( get_post_status( $post->ID ) ) );
    481479        ?>
    482                 <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status . ' ' . $post_format_class); ?> iedit' valign="top">
     480                <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' ' . $the_post_class ); ?> iedit' valign="top">
    483481        <?php
    484482
    485483                list( $columns, $hidden ) = $this->get_column_info();