Ah, yes, since 2011 😂
@nano09 Take a look at the “Return Value” field in the Taxonomy field configuration. https://www.advancedcustomfields.com/resources/taxonomy/ It allows you to choose whether you want the Term ID or the Term Object in your code.
It’s possible that the $context
already contains an ACF object with the key acf
and your code overwrites it. This will then destroy any subsequent use of $context['acf']
which Timber (or your Theme) needs.
Try using a different key in your own code ($context['my_acf']
) and see whether that helps, or just do a var_dump
of $context['acf']
before the first line of code in your example, to see whether it already exists. Timber objects/context already have a lot of data in them, which you might not know already exists.
You might find it easier to create a Custom Post Type for the entries, then add custom fields to each Post using an ACF field group. The output as a table would then loop through the Posts. Your table is essentially, a Post list.
You can configure the return value of the field to give you the Taxonomy (category) object instead of the ID.
In which field is the data stored? If you want to send all of the post data to the remote API, you can use https://www.advancedcustomfields.com/resources/get_fields/ and send the resultant array.
Only four years late 😉
add_filter('acf/get_post_types', function ($post_types) {
if(!in_array('acf-field-group', $post_types)){
$post_types[] = 'acf-field-group';
}
return $post_types;
}, 10, 1);
Same here – WordPress 4.9.8 and ACF Pro 5.7.6. It looks as though the key (added according to the docs for acf_update_setting
) isn’t being appended to the request to the Google Maps API. This has worked seamlessly for quite a while and appears to have only stopped working recently. Funnily enough, the address search function works and the value of the field is saved. It’s just that the map itself is covered by a semi-transparent dark overlay.
Moving the call to acf_form_head
before wp_head
fixed the issue. Thanks Elliot.
Have sent the link to this ticket. Thanks John.
Great idea, thanks for the tip John.
Ah, so catch it before it even tries to submit?
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.