Changeset 39966
- Timestamp:
- 01/26/2017 01:51:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7/src/wp-includes/query.php
r25955 r39966 2658 2658 if ( 'any' == $post_type ) { 2659 2659 $in_search_post_types = get_post_types( array('exclude_from_search' => false) ); 2660 if ( empty( $in_search_post_types ) ) 2660 if ( empty( $in_search_post_types ) ) { 2661 2661 $where .= ' AND 1=0 '; 2662 else 2663 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')"; 2662 } else { 2663 $where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')"; 2664 } 2664 2665 } elseif ( !empty( $post_type ) && is_array( $post_type ) ) { 2665 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";2666 $where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", esc_sql( $post_type ) ) . "')"; 2666 2667 } elseif ( ! empty( $post_type ) ) { 2667 $where .= " AND $wpdb->posts.post_type = '$post_type'";2668 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type ); 2668 2669 $post_type_object = get_post_type_object ( $post_type ); 2669 2670 } elseif ( $this->is_attachment ) {
Note: See TracChangeset
for help on using the changeset viewer.