Changeset 5750

Show
Ignore:
Timestamp:
06/24/07 05:58:38 (1 year ago)
Author:
markjaquith
Message:

Order pending posts nag by post_modified ASC, drafts by post_modified DESC

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/includes/user.php

    r5707 r5750  
    194194        $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) "; 
    195195 
     196    $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC'; 
     197 
    196198    if( !$editable ) { 
    197199        $other_unpubs = ''; 
    198200    } else { 
    199201        $editable = join(',', $editable); 
    200         $other_unpubs = $wpdb->get_results("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != '$user_id' "); 
     202        $other_unpubs = $wpdb->get_results("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != '$user_id' ORDER BY post_modified $dir"); 
    201203    } 
    202204 
     
    232234    global $wpdb; 
    233235    $user_id = (int) $user_id; 
    234     $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"; 
     236    $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = $user_id ORDER BY post_modified DESC"; 
    235237    $query = apply_filters('get_users_drafts', $query); 
    236238    return $wpdb->get_results( $query );