Just updated to pro 5.7.10, still no solution?
Hi Bee,
I do know how the field works. What i meant was on this page it would be nice to have, the field type and how its written in the php code
array('type' => "true_false")
as a reference for developing. Most of the other field types are quite self explanatory, but this one, you can write it several ways…. 😉
Greets Gerhard
Has anyone a idea how to check the post type when using prepare field?
My form is generated in a shortcode, so using the global $post is not a option.
Hi, in now im late but maybe this helps someone else…
With ACF Pro you can try something like:
$fields = array();
$groups = acf_get_field_groups(array('post_type' => 'kontakte'));
foreach($groups as $group){
$fields[$group['title']] = $group;
$f = acf_get_fields($group['ID']);
foreach($f as $i){
$fields[$group['title']]['fields'][$i['name']] = $i;
$fields[$group['title']]['fields'][$i['name']]['value'] = get_field($i['key']);
}
}
Greets
Is your post type hierarchical?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.