Ticket #18615: 18615.2.patch
File 18615.2.patch, 3.2 KB (added by , 13 years ago) |
---|
-
admin-ajax.php
1236 1236 $wp_list_table = _get_list_table('WP_Posts_List_Table'); 1237 1237 1238 1238 $mode = $_POST['post_view']; 1239 $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) ); 1239 1240 $level = 0; 1241 $request_post = array( get_post( $_POST['post_ID'] ) ); 1242 $parent = $request_post[0]->post_parent; 1243 while ( $parent > 0 ) { 1244 $parent_post = get_post( $parent ); 1245 $parent = $parent_post->post_parent; 1246 $level++; 1247 } 1240 1248 1249 $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ), $level ); 1250 1241 1251 exit; 1242 1252 break; 1243 1253 case 'inline-save-tax': … … 1269 1279 die( $tag->get_error_message() ); 1270 1280 die( __('Item not updated.') ); 1271 1281 } 1272 1273 echo $wp_list_table->single_row( $tag ); 1282 $level = 0; 1283 $parent = $tag->parent; 1284 while ( $parent > 0 ) { 1285 $parent_tag = get_term( $parent, $taxonomy ); 1286 $parent = $parent_tag->parent; 1287 $level++; 1288 } 1289 echo $wp_list_table->single_row( $tag, $level ); 1274 1290 } else { 1275 1291 if ( is_wp_error($updated) && $updated->get_error_message() ) 1276 1292 die( $updated->get_error_message() ); -
includes/class-wp-posts-list-table.php
300 300 ); 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 306 306 if ( empty( $posts ) ) … … 311 311 if ( $this->hierarchical_display ) { 312 312 $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page ); 313 313 } else { 314 $this->_display_rows( $posts );314 $this->_display_rows( $posts, $level ); 315 315 } 316 316 } 317 317 318 function _display_rows( $posts ) {318 function _display_rows( $posts, $level = 0 ) { 319 319 global $post, $mode; 320 320 321 321 // Create array of post IDs. … … 327 327 $this->comment_pending_count = get_pending_comments_num( $post_ids ); 328 328 329 329 foreach ( $posts as $post ) 330 $this->single_row( $post );330 $this->single_row( $post, $level ); 331 331 } 332 332 333 333 function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) { … … 524 524 } 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 ) { 531 533 the_excerpt();