Changeset 21192
- Timestamp:
- 06/30/2012 09:28:15 AM (12 years ago)
- Location:
- trunk/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ajax-actions.php
r21191 r21192 1369 1369 1370 1370 $mode = $_POST['post_view']; 1371 $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) ); 1371 1372 $level = 0; 1373 $request_post = array( get_post( $_POST['post_ID'] ) ); 1374 $parent = $request_post[0]->post_parent; 1375 1376 while ( $parent > 0 ) { 1377 $parent_post = get_post( $parent ); 1378 $parent = $parent_post->post_parent; 1379 $level++; 1380 } 1381 1382 $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ), $level ); 1372 1383 1373 1384 wp_die(); -
trunk/wp-admin/includes/class-wp-posts-list-table.php
r21162 r21192 301 301 } 302 302 303 function display_rows( $posts = array() ) {303 function display_rows( $posts = array(), $level = 0 ) { 304 304 global $wp_query, $post_type_object, $per_page; 305 305 … … 312 312 $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page ); 313 313 } 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 ) { 319 319 global $post, $mode; 320 320 … … 328 328 329 329 foreach ( $posts as $post ) 330 $this->single_row( $post );330 $this->single_row( $post, $level ); 331 331 } 332 332 … … 525 525 else { 526 526 $attributes = 'class="post-title page-title column-title"' . $style; 527 528 $pad = str_repeat( '— ', $level ); 527 529 ?> 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 “%s”' ), $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 “%s”' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); ?></strong> 529 531 <?php 530 532 if ( 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) )
Note: See TracChangeset
for help on using the changeset viewer.