Don't show other drafts on one-user blogs - http://mosquito.wordpress.org/view.php?id=723
git-svn-id: https://develop.svn.wordpress.org/trunk@2132 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d24a38306a
commit
cd7f1c76dd
@ -12,10 +12,12 @@ get_currentuserinfo();
|
||||
$drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
|
||||
if (1 < $user_level) {
|
||||
$editable = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_level <= '$user_level' AND ID != $user_ID");
|
||||
if( is_array( $editable ) == false )
|
||||
$editable = array( "1" );
|
||||
$editable = join(',', $editable);
|
||||
$other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) ");
|
||||
if( is_array( $editable ) == false )
|
||||
$other_drafts = '';
|
||||
else {
|
||||
$editable = join(',', $editable);
|
||||
$other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) ");
|
||||
}
|
||||
} else {
|
||||
$other_drafts = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user