$post_type, ] ); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $component = $customfields->get_component( $fields_type ); $fields = $component->get_fields( get_the_ID() ); if ( $fields ) { foreach( $fields as $name => $value ) { $meta_fields[ $name ] = $value; } } } wp_reset_postdata(); } return $meta_fields; } }