Changeset 7109 for trunk/wp-includes/query.php
- Timestamp:
- 02/29/2008 09:49:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r7070 r7109 1214 1214 $q_status = explode(',', $q['post_status']); 1215 1215 $r_status = array(); 1216 $p_status = array(); 1216 1217 if ( in_array( 'draft' , $q_status ) ) 1217 1218 $r_status[] = "post_status = 'draft'"; … … 1223 1224 $r_status[] = "post_status = 'inherit'"; 1224 1225 if ( in_array( 'private', $q_status ) ) 1225 $ r_status[] = "post_status = 'private'";1226 $p_status[] = "post_status = 'private'"; 1226 1227 if ( in_array( 'publish', $q_status ) ) 1227 1228 $r_status[] = "post_status = 'publish'"; 1228 if ( !empty($r_status) ) 1229 $where .= " AND (" . join( ' OR ', $r_status ) . ")"; 1229 1230 if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) { 1231 $r_status = array_merge($r_status, $p_status); 1232 unset($p_status); 1233 } 1234 1235 if ( !empty($r_status) ) { 1236 if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can("edit_others_{$post_type}s") ) 1237 $where .= " AND (post_author = $user_ID " . "AND (" . join( ' OR ', $r_status ) . "))"; 1238 else 1239 $where .= " AND (" . join( ' OR ', $r_status ) . ")"; 1240 } 1241 if ( !empty($p_status) ) { 1242 if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can("read_private_{$post_type}s") ) 1243 $where .= " AND (post_author = $user_ID " . "AND (" . join( ' OR ', $p_status ) . "))"; 1244 else 1245 $where .= " AND (" . join( ' OR ', $p_status ) . ")"; 1246 } 1230 1247 } elseif ( !$this->is_singular ) { 1231 1248 $where .= " AND (post_status = 'publish'";
Note: See TracChangeset
for help on using the changeset viewer.