Ticket #30354: 30354.patch
File 30354.patch, 875 bytes (added by , 6 years ago) |
---|
-
src/wp-includes/post.php
5266 5266 if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) ) { 5267 5267 $cap = $post_type_obj->cap->read_private_posts; 5268 5268 } 5269 $sql = ''; 5270 if ( $full ) { 5271 $sql .= 'WHERE '; 5272 } 5269 5273 5270 if ( $full ) {5271 5274 if ( null === $post_author ) { 5272 $sql = $wpdb->prepare( ' WHEREpost_type = %s AND ', $post_type );5275 $sql = $wpdb->prepare( 'post_type = %s AND ', $post_type ); 5273 5276 } else { 5274 $sql = $wpdb->prepare( ' WHEREpost_author = %d AND post_type = %s AND ', $post_author, $post_type );5277 $sql = $wpdb->prepare( 'post_author = %d AND post_type = %s AND ', $post_author, $post_type ); 5275 5278 } 5276 } else {5277 $sql = '';5278 }5279 5279 5280 5280 $sql .= "(post_status = 'publish'"; 5281 5281