Changeset 5707 for trunk/wp-admin/includes/user.php
- Timestamp:
- 06/14/2007 04:24:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/user.php
r5566 r5707 182 182 } 183 183 184 function get_others_ drafts( $user_id) {184 function get_others_unpublished_posts($user_id, $type='any') { 185 185 global $wpdb; 186 186 $user = get_userdata( $user_id ); … … 189 189 $editable = get_editable_user_ids( $user_id ); 190 190 191 if ( in_array($type, array('draft', 'pending')) ) 192 $type_sql = " post_status = '$type' "; 193 else 194 $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) "; 195 191 196 if( !$editable ) { 192 $other_ drafts = '';197 $other_unpubs = ''; 193 198 } else { 194 199 $editable = join(',', $editable); 195 $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' "); 196 } 197 198 return apply_filters('get_others_drafts', $other_drafts); 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' "); 201 } 202 203 return apply_filters('get_others_drafts', $other_unpubs); 204 } 205 206 function get_others_drafts($user_id) { 207 return get_others_unpublished_posts($user_id, 'draft'); 208 } 209 210 function get_others_pending($user_id) { 211 return get_others_unpublished_posts($user_id, 'pending'); 199 212 } 200 213
Note: See TracChangeset
for help on using the changeset viewer.