Wondering the same. This seems to affect all block editor values, such as
$block['style']['elements']['link']['color']['text']
that now have values like var:preset|color|blue
.
Thanks for your suggestions! I completely forgot about this issue, but I just tested this for future reference and it turns out that $post
object isn’t available yet when registering ACF Blocks using acf/init
action (as suggested in the acf_register_block_type documentation). So it’s probably better to just put the data in data-attributes in the template/render_callback and read them from there, or pass them some other way, especially if it’s just a few parameters.
Solved. Needed to trigger change
event for ACF to register values.
Can’t get it to show on front end or in admin?
Make sure your field group location settings are “Page is equal to Shop” and in the template file archive-product.php
you need to use the page id to fetch the values:
$page_id = wc_get_page_id( 'shop' );
$your_field = get_field( 'your_field', $page_id );
I’m having the same issue with file and image fields.
I have a field group assigned for a custom post type and every time I update / publish an existing or new post, I get a duplicate of that post. If I change the image / file field to a text input (text, url, mail etc.) everything works as expected and no duplicate post is created on publish / update.
ACF 5.5.4
WP 4.7.1
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.