Make WordPress Core


Ignore:
Timestamp:
02/14/2006 06:23:03 AM (19 years ago)
Author:
ryan
Message:

Don't show private and draft pages in post lists. fixes #2442

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-db.php

    r3517 r3528  
    44    global $wpdb;
    55    $user_id = (int) $user_id;
    6     $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_id ORDER BY ID DESC";
     6    $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = $user_id ORDER BY ID DESC";
    77    $query = apply_filters('get_users_drafts', $query);
    88    return $wpdb->get_results( $query );
     
    2020    } else {
    2121        $editable = join(',', $editable);
    22         $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) AND post_author != '$user_id' ");
     22        $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author IN ($editable) AND post_author != '$user_id' ");
    2323    }
    2424
Note: See TracChangeset for help on using the changeset viewer.