Your support system is down……
Hi there,
I have a problem with ACF Gutenberg blocks not working in specific case.
I want to be able to select specific news + specific tags.
So I created this field:
acf_add_local_field_group(array(
'key' => 'group_5cbe885ee190f',
'title' => 'Block: Related content',
'fields' => array(
array(
'key' => 'field_5cbe88701e944',
'label' => 'Related case studies',
'name' => 'related_case_studies',
'type' => 'post_object',
'instructions' => 'Select related case studies',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'post_type' => array(
0 => 'post',
),
'taxonomy' => '',
'allow_null' => 0,
'multiple' => 1,
'return_format' => 'id',
'ui' => 1,
),
array(
'key' => 'field_5cbe43102f4e6',
'label' => 'Related tag',
'name' => 'related_tag',
'type' => 'taxonomy',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'taxonomy' => 'post_tag',
'field_type' => 'multi_select',
'allow_null' => 0,
'add_term' => 0,
'save_terms' => 0,
'load_terms' => 1,
'return_format' => 'id',
'multiple' => 0,
),
array(
'key' => 'field_5cbfe272c9326',
'label' => 'Block title',
'name' => 'block_title',
'type' => 'text',
'instructions' => 'The title to use eg: "More Insights". Defaults to "Related".',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => 'Related',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
),
'location' => array(
array(
array(
'param' => 'block',
'operator' => '==',
'value' => 'acf/related',
),
),
),
'menu_order' => 0,
'position' => 'acf_after_title',
'style' => 'seamless',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
));
Now out of this post and title works but tag doesn’t. Why? Because it’s not recognised by ACF. Here’s test post content:
<!-- wp:acf/related {"id":"block_60055cc22371a","name":"acf/related","data":{"related_case_studies":["16043"],"_related_case_studies":"field_5cbe88701e944","related_tag":["240"],"_related_tag":"field_5cbe43102f4e6","block_title":"Related","_block_title":"field_5cbfe272c9326"},"align":"","mode":"preview"} /-->
When admin page loads, case study field preloads with the right article, but tag field doesn’t – it’s empty on the sidebar. And the ID is correct 240 is correct taxonomy ID. Any hints?
You must be logged in to reply to this topic.
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.