Home › Forums › ACF PRO › ACF Form – form taxonomy check by default › Reply To: ACF Form – form taxonomy check by default
Thank you , unfortunately it is still not functional
add_action( 'genesis_entry_content', 'tsm_do_create_post_form' );
function tsm_do_create_post_form() {
// Bail if not logged in or able to post
if ( ! ( is_user_logged_in()|| current_user_can('publish_posts') ) ) {
echo do_shortcode( '[wppb-login] ' );
return;
}
$new_post = array(
'post_id' => 'new', // Create a new post
'field_groups' => array('group_54dfc93792c38', 'group_56afa46678eb3', 'group_56afa46adc147', 'group_569a815405075', 'group_56ab8bb40edcc', 'group_56bdf6aa906e1'), // Create post field group ID(s)
'form' => true,
'return' => '%post_url%', // Redirect to new post url
'html_before_fields' => '',
'html_after_fields' => '',
'submit_value' => 'Poster',
'updated_message' => 'Saved!'
);
acf_form( $new_post );
// Catégorie
add_filter('acf/load_field/key=field_54dfccb977a11', 'vivi_load_post_category');
}
function vivi_load_post_category($field) {
$field['default_value'] = array(72);
return $field;
}
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.