WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/09/2010 12:18:52 PM (10 years ago)
Author:
scribu
Message:

Fix warning caused by empty meta query. See #14645

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r15766 r15768  
    21142114        }
    21152115
    2116         list( $meta_join, $meta_where ) = $this->get_meta_sql( $q['meta_query'], $wpdb->posts, 'ID', $wpdb->postmeta, 'post_id' );
    2117         $join .= $meta_join;
    2118         $where .= $meta_where;
     2116        if ( !empty( $q['meta_query'] ) ) {
     2117            list( $meta_join, $meta_where ) = $this->get_meta_sql( $q['meta_query'], $wpdb->posts, 'ID', $wpdb->postmeta, 'post_id' );
     2118            $join .= $meta_join;
     2119            $where .= $meta_where;
     2120        }
    21192121
    21202122        // Apply filters on where and join prior to paging so that any
Note: See TracChangeset for help on using the changeset viewer.