Support

Account

Home Forums General Issues WP Query based on whether repeater has rows or not Reply To: WP Query based on whether repeater has rows or not

  • The repeater field holds an integer representing the number of rows. The meta query would look something like this

    
    $meta_query = array(
      'relation' => 'AND',
      array(
        'key' => 'your-repeater-field-name',
        'compare' => 'EXISTS'
      ),
      array(
        'key' => 'your-repeater-field-name',
        'value' => 0,
        'type' => 'NUMERIC'
        'compare' => '>'
      ),
    )
    

    the meta_key exists and it’s value is > 0