Hey im trying to display a taxonomy field and i would like to only show my parent categories and not the subcategories.
Im using acf_form heres my code:
$settings = array(
'post_id' => 'new_post',
'new_post' => array(
'post_type' => 'contrats',
'post_status' => 'pending'
),
'post_title' => true,
'submit_value' => 'Nouveau contrat créé !',
'submit_value' => __("PUBLIER"),
'field_groups' => array(27)
);
acf_form($settings);
And here a screenshot:
You can adjust the get_terms() augments used by ACF by creating a filter https://www.advancedcustomfields.com/resources/acf-fields-taxonomy-query/
$args['parent'] = 0;