WordPress.org

Make WordPress Core

Ticket #17859: 17859.diff

File 17859.diff, 899 bytes (added by kawauso, 3 years ago)

Add private to post_status clause

  • wp-admin/admin-ajax.php

     
    12921292        if ( count($search_terms) > 1 && $search_terms[0] != $s ) 
    12931293                $search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')"; 
    12941294 
    1295         $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" ); 
     1295        $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish', 'private') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" ); 
    12961296 
    12971297        if ( ! $posts ) { 
    12981298                $posttype = get_post_type_object($what);