Changeset 39965 for branches/3.8/src/wp-includes/query.php
- Timestamp:
- 01/26/2017 01:51:16 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8/src/wp-includes/query.php
r27647 r39965 2676 2676 if ( 'any' == $post_type ) { 2677 2677 $in_search_post_types = get_post_types( array('exclude_from_search' => false) ); 2678 if ( empty( $in_search_post_types ) ) 2678 if ( empty( $in_search_post_types ) ) { 2679 2679 $where .= ' AND 1=0 '; 2680 else 2681 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')"; 2680 } else { 2681 $where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')"; 2682 } 2682 2683 } elseif ( !empty( $post_type ) && is_array( $post_type ) ) { 2683 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";2684 $where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", esc_sql( $post_type ) ) . "')"; 2684 2685 } elseif ( ! empty( $post_type ) ) { 2685 $where .= " AND $wpdb->posts.post_type = '$post_type'";2686 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type ); 2686 2687 $post_type_object = get_post_type_object ( $post_type ); 2687 2688 } elseif ( $this->is_attachment ) {
Note: See TracChangeset
for help on using the changeset viewer.