Changeset 25669 for trunk/src/wp-includes/query.php
- Timestamp:
- 10/02/2013 09:09:52 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r25668 r25669 2141 2141 */ 2142 2142 function get_posts() { 2143 global $wpdb , $user_ID;2143 global $wpdb; 2144 2144 2145 2145 $this->parse_query(); … … 2714 2714 } 2715 2715 2716 $user_id = get_current_user_id(); 2717 2716 2718 if ( !empty($e_status) ) { 2717 2719 $statuswheres[] = "(" . join( ' AND ', $e_status ) . ")"; … … 2719 2721 if ( !empty($r_status) ) { 2720 2722 if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can($edit_others_cap) ) 2721 $statuswheres[] = "($wpdb->posts.post_author = $user_ ID" . "AND (" . join( ' OR ', $r_status ) . "))";2723 $statuswheres[] = "($wpdb->posts.post_author = $user_id " . "AND (" . join( ' OR ', $r_status ) . "))"; 2722 2724 else 2723 2725 $statuswheres[] = "(" . join( ' OR ', $r_status ) . ")"; … … 2725 2727 if ( !empty($p_status) ) { 2726 2728 if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can($read_private_cap) ) 2727 $statuswheres[] = "($wpdb->posts.post_author = $user_ ID" . "AND (" . join( ' OR ', $p_status ) . "))";2729 $statuswheres[] = "($wpdb->posts.post_author = $user_id " . "AND (" . join( ' OR ', $p_status ) . "))"; 2728 2730 else 2729 2731 $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")"; … … 2758 2760 $private_states = get_post_stati( array('private' => true) ); 2759 2761 foreach ( (array) $private_states as $state ) 2760 $where .= current_user_can( $read_private_cap ) ? " OR $wpdb->posts.post_status = '$state'" : " OR $wpdb->posts.post_author = $user_ IDAND $wpdb->posts.post_status = '$state'";2762 $where .= current_user_can( $read_private_cap ) ? " OR $wpdb->posts.post_status = '$state'" : " OR $wpdb->posts.post_author = $user_id AND $wpdb->posts.post_status = '$state'"; 2761 2763 } 2762 2764
Note: See TracChangeset
for help on using the changeset viewer.