Make WordPress Core

Changeset 3528


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

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

Location:
trunk
Files:
3 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
  • trunk/wp-admin/edit.php

    r3517 r3528  
    8585</form>
    8686
    87 <?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_date != '0000-00-00 00:00:00' ORDER BY post_date DESC");
     87<?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC");
    8888
    8989if ( count($arc_result) ) { ?>
  • trunk/wp-includes/classes.php

    r3527 r3528  
    588588                        $where .= ' AND (post_type = "post")';
    589589                } else {
    590                         $where .= ' AND (post_type = "post" AND post_status = "publish"';
     590                        $where .= ' AND (post_type = "post" AND (post_status = "publish"';
    591591
    592592                        if ( $pagenow == 'post.php' || $pagenow == 'edit.php' )
    … …  
    596596       
    597597                        if ( is_user_logged_in() )
    598                                 $where .= " OR post_author = $user_ID AND post_status = 'private')";
     598                                $where .= " OR post_author = $user_ID AND post_status = 'private'))";
    599599                        else
    600                                 $where .= ')';
     600                                $where .= '))';
    601601                }
    602602
Note: See TracChangeset for help on using the changeset viewer.