Make WordPress Core

Changeset 24238


Ignore:
Timestamp:
05/10/2013 07:18:54 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Fix handling of '0' as meta_value argument in get_pages(). fixes #20376.

File:
1 edited

Legend:

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

    r24229 r24238  
    36863686    $join = '';
    36873687    $where = "$exclusions $inclusions ";
    3688     if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) {
     3688    if ( '' !== $meta_key || '' !== $meta_value ) {
    36893689        $join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )";
    36903690
     
    36923692        $meta_key = wp_unslash($meta_key);
    36933693        $meta_value = wp_unslash($meta_value);
    3694         if ( ! empty( $meta_key ) )
     3694        if ( '' !== $meta_key )
    36953695            $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s", $meta_key);
    3696         if ( ! empty( $meta_value ) )
     3696        if ( '' !== $meta_value )
    36973697            $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_value = %s", $meta_value);
    36983698
Note: See TracChangeset for help on using the changeset viewer.