Changeset 39958
- Timestamp:
- 01/26/2017 01:49:12 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.5/src/wp-includes/query.php
r37075 r39958 3053 3053 if ( 'any' == $post_type ) { 3054 3054 $in_search_post_types = get_post_types( array('exclude_from_search' => false) ); 3055 if ( empty( $in_search_post_types ) ) 3055 if ( empty( $in_search_post_types ) ) { 3056 3056 $where .= ' AND 1=0 '; 3057 else 3058 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')"; 3057 } else { 3058 $where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')"; 3059 } 3059 3060 } elseif ( !empty( $post_type ) && is_array( $post_type ) ) { 3060 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";3061 $where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", esc_sql( $post_type ) ) . "')"; 3061 3062 } elseif ( ! empty( $post_type ) ) { 3062 $where .= " AND $wpdb->posts.post_type = '$post_type'";3063 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type ); 3063 3064 $post_type_object = get_post_type_object ( $post_type ); 3064 3065 } elseif ( $this->is_attachment ) {
Note: See TracChangeset
for help on using the changeset viewer.