Make WordPress Core


Ignore:
Timestamp:
06/30/2012 09:28:15 AM (13 years ago)
Author:
markjaquith
Message:

Prevent child pages from being visually promoted to the top level after Quick Edit. props ssamture. fixes #18615

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r21162 r21192  
    301301    }
    302302
    303     function display_rows( $posts = array() ) {
     303    function display_rows( $posts = array(), $level = 0 ) {
    304304        global $wp_query, $post_type_object, $per_page;
    305305
     
    312312            $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page );
    313313        } else {
    314             $this->_display_rows( $posts );
    315         }
    316     }
    317 
    318     function _display_rows( $posts ) {
     314            $this->_display_rows( $posts, $level );
     315        }
     316    }
     317
     318    function _display_rows( $posts, $level = 0 ) {
    319319        global $post, $mode;
    320320
     
    328328
    329329        foreach ( $posts as $post )
    330             $this->single_row( $post );
     330            $this->single_row( $post, $level );
    331331    }
    332332
     
    525525                else {
    526526                    $attributes = 'class="post-title page-title column-title"' . $style;
     527                   
     528                    $pad = str_repeat( '— ', $level );
    527529?>
    528             <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states( $post ); ?></strong>
     530            <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); ?></strong>
    529531<?php
    530532                    if ( 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) )
Note: See TracChangeset for help on using the changeset viewer.