Wait, now that I’m thinking about this (should have done this earliers, but is just popped up :-)) I can use a WP function to return the post id by using the slug!
function get_ID_by_slug($page_slug) {
$page = get_page_by_path($page_slug);
if ($page) {
return $page->ID;
}
else {
return null;
}
}
Another thing I noticed that tabs still show up as an empty key:
[custom_fields] => Array
(
[blocks] => Array
(
[0] => Array
(
[acf_fc_layout] => content_block
[] =>
[title] => This is the title
[content] => This is the content
[fixed_bg] => 1
)
)
)
Not sure if this has anything to do with it, since we are using multiple tabs… wp_cache_get sets the found to true, while the result is empty (api-field.php line 454)
Did another small test
while ( has_sub_field('blocks') ) :
print_r(get_sub_field('title'));
print_r(get_sub_field('content'));
endwhile;
Shows only the title.
While using
get_post_meta($post->ID)
Shows the content key in the array
[blocks_0_content] => Array
(
[0] => Bla bla bla
)
[_blocks_0_content] => Array
(
[0] => field_53fc61e4d4240
)