Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#16735 closed defect (bug) (duplicate)

Querying against empty meta_value should work

Reported by: scribu's profile scribu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description

This should work:

      $args = array(
        'meta_query' => array(
          array(
            'key' => 'featured_image',
            'value' => '',
            'compare' => '!='
          )
        )
      );
      $query = new WP_Query( $args );

Source: http://wordpress.stackexchange.com/questions/10881/how-can-i-show-posts-only-if-meta-value-is-not-empty

Change History (1)

#1 @dd32
14 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

See #16573 See #15292

Note: See TracTickets for help on using tickets.