I have a custom post type 'orders' and there are a few custom fields attached to this post type.
When I query all orders like so:
$orders = new WP_Query( array( 'post_type' => 'orders') );
I don't get all the data I wish to get.
I have a tab custom field with a repeater in it. And I kinda need the data from the repeater. Anyone knows why I don't get this data in the dump of $orders?
Should my query be something else to get all this data?
EDIT
I've managed to query this array:
Array
(
[0] => Array
(
[0] => Array
(
[attractie] => WP_Post Object
(
[ID] => 41
[post_author] => 1
[post_date] => 2016-02-29 14:30:33
[post_date_gmt] => 2016-02-29 14:30:33
[post_content] => <h2>Title!</h2>
Content.
[post_title] => Post Title
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => post-name
[to_ping] =>
[pinged] =>
[post_modified] => 2016-04-07 14:39:41
[post_modified_gmt] => 2016-04-07 14:39:41
[post_content_filtered] =>
[post_parent] => 0
[guid] => url
[menu_order] => 0
[post_type] => attracties
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
[start] => 0930
[end] => 1200
)
[1] => Array
(
[attractie] =>
[start] => 0930
[end] => 1200
)
)
With this code:
$orders = new WP_Query( array( 'post_type' => 'orders') );
foreach ( $orders->posts as $all ) {
$fields[] = get_field( 'planning', $all->ID );
}
What I basically need now is the post_title value from the attractie WP_Post Object and the start and end values.