WordPress.org

Make WordPress Core

Ticket #17935: admin-ajax.diff

File admin-ajax.diff, 666 bytes (added by postpostmodern, 3 years ago)

Modifying inline-save action (Quick Edit) to use WP_Query rather than get_post()

  • admin-ajax.php

     
    12251225 
    12261226        $wp_list_table = _get_list_table('WP_Posts_List_Table'); 
    12271227 
    1228         $mode = $_POST['post_view']; 
    1229         $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) ); 
    1230  
     1228        $post_type = $_POST['post_type']; 
     1229        $posts = get_posts( array('p' => $post_ID, 'post_type' => $post_type, 'post_status' => 'any', 'suppress_filters' => FALSE, 'posts_per_page' => 1) ); 
     1230         
     1231        if( isset($posts[0]) ) 
     1232                $wp_list_table->display_rows( array($posts[0]) ); 
     1233         
    12311234        exit; 
    12321235        break; 
    12331236case 'inline-save-tax':