I am using a basic ACF_form
for users to submit posts from the front-end. For this scenario, I am using a form to submit to specific taxonomy type – I do not want the user to be able to select it.
<?php
acf_form(array(
'post_id' => 'new_post',
'post_title' => true,
'new_post' => array(
'post_type' => 'cpt',
'post_status' => 'publish',
'post_taxonomy' => '3' // Understand this is not correct
),
)
);
An alternative method I attempted was to create a taxonomy field on the form and set the radio choice via filters, but don’t believe there is a default_value
for the taxonomy type?
add_filter('acf/load_value/name=field_5a61caf5b0569', 'cpt_cat_type');
function cpt_cat_type($field) {
$field['default_value'] = 4;
return $field;
}