WordPress.org

Make WordPress Core

Ticket #23312: 23312.diff

File 23312.diff, 2.8 KB (added by dh-shredder, 5 months ago)

Initial Pass.

  • wp-admin/css/wp-admin.css

    diff --git wp-admin/css/wp-admin.css wp-admin/css/wp-admin.css
    index 6e37066..ffb36a5 100644
    table.fixed { 
    25272527        background-repeat: no-repeat; 
    25282528} 
    25292529 
     2530.locked-indicator { 
     2531        background: url('../images/lock_16x16x32.png') no-repeat; 
     2532        margin: 0 0 0 8px; 
     2533        height: 16px; 
     2534        width: 16px; 
     2535} 
     2536 
    25302537.fixed .column-comments .sorting-indicator { 
    25312538        margin-top: 3px; 
    25322539} 
  • wp-admin/includes/class-wp-posts-list-table.php

    diff --git wp-admin/images/lock_16x16x32.png wp-admin/images/lock_16x16x32.png
    new file mode 100644
    index 0000000..8f66ac5
    Binary files /dev/null and wp-admin/images/lock_16x16x32.png differ
    diff --git wp-admin/includes/class-wp-posts-list-table.php wp-admin/includes/class-wp-posts-list-table.php
    index 2f47867..03e7e1e 100644
    class WP_Posts_List_Table extends WP_List_Table { 
    472472                $title = _draft_or_post_title(); 
    473473                $post_type_object = get_post_type_object( $post->post_type ); 
    474474                $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID ); 
     475                $post_is_locked = wp_check_post_lock( $post->ID ); 
    475476 
    476477                $alternate = 'alternate' == $alternate ? '' : 'alternate'; 
    477478                $classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' ); 
    class WP_Posts_List_Table extends WP_List_Table { 
    495496                        case 'cb': 
    496497                        ?> 
    497498                        <th scope="row" class="check-column"> 
    498                                 <?php if ( $can_edit_post ) { ?> 
     499                        <?php 
     500                                if ( $can_edit_post ) { 
     501                                        if ( !$post_is_locked ) { 
     502                        ?> 
    499503                                <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title ); ?></label> 
    500504                                <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" /> 
    501                                 <?php } ?> 
     505 
     506                        <?php   } else { ?> 
     507                                <div class="locked-indicator"></div> 
     508                        <?php 
     509                                        } 
     510                                } 
     511                        ?> 
    502512                        </th> 
    503513                        <?php 
    504514                        break; 
    class WP_Posts_List_Table extends WP_List_Table { 
    543553                                $actions = array(); 
    544554                                if ( $can_edit_post && 'trash' != $post->post_status ) { 
    545555                                        $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>'; 
    546                                         $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>'; 
     556 
     557                                        if ( !$post_is_locked ) { 
     558                                                $actions['inline hide-if-no-js'] = 
     559                                                        '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . 
     560                                                                __( 'Quick&nbsp;Edit' ) . 
     561                                                        '</a>'; 
     562                                        } 
    547563                                } 
    548564                                if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) { 
    549565                                        if ( 'trash' == $post->post_status )