Get All Fields for All Group Custom Post Types
// WP_Query arguments
$args = array(
'post_type' => array( 'group' ),
'post_status' => array( 'publish' ),
'has_password' => false,
'nopaging' => false,
'posts_per_page' => '10',
'posts_per_archive_page' => '10',
'ignore_sticky_posts' => false,
'order' => 'ASC',
'orderby' => 'title',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'post_id',
'value' => '1944,1945,1946,1947,1948',
'compare' => 'IN',
'type' => 'NUMERIC',
),
array(
'key' => '_form_id',
'value' => '2',
'compare' => '=',
'type' => 'UNSIGNED',
),
array(
'key' => '_field_10',
'compare' => 'EXISTS',
'type' => 'UNSIGNED',
),
array(
'key' => '_field_5',
'compare' => 'EXISTS',
'type' => 'CHAR',
),
array(
'key' => '_field_7',
'compare' => 'EXISTS',
'type' => 'CHAR',
),
),
);
// The Query
$query_group = new WP_Query( $args );
// The Loop
if ( $query_group->have_posts() ) {
while ( $query_group->have_posts() ) {
$query_group->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();