Changeset 39955 for branches/4.6/src/wp-includes/query.php
- Timestamp:
- 01/26/2017 01:39:03 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6/src/wp-includes/query.php
r38125 r39955 3070 3070 if ( 'any' == $post_type ) { 3071 3071 $in_search_post_types = get_post_types( array('exclude_from_search' => false) ); 3072 if ( empty( $in_search_post_types ) ) 3072 if ( empty( $in_search_post_types ) ) { 3073 3073 $where .= ' AND 1=0 '; 3074 else 3075 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')"; 3074 } else { 3075 $where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')"; 3076 } 3076 3077 } elseif ( !empty( $post_type ) && is_array( $post_type ) ) { 3077 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";3078 $where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", esc_sql( $post_type ) ) . "')"; 3078 3079 } elseif ( ! empty( $post_type ) ) { 3079 $where .= " AND $wpdb->posts.post_type = '$post_type'";3080 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type ); 3080 3081 $post_type_object = get_post_type_object ( $post_type ); 3081 3082 } elseif ( $this->is_attachment ) {
Note: See TracChangeset
for help on using the changeset viewer.