Support

Account

Home Forums Front-end Issues Save taxonomy on submit ACF Form

Helping

Save taxonomy on submit ACF Form

    • bigthi

    • May 14, 2020 at 2:05 am

    Hi!

    I have a acf_form on front-end and it’s working very well. It’s a CPT called “Recipes”.

    The user fills some fields and on submit, it’s being saved.

    Now I need to add a custom taxonomy to this post. They are already created in the admin and the user select it as a <select> field on the front-end.

    Eg.:
    Recipe Title: Bread
    Description: Lorem ipsum…

    Category: <select>

    The actual code is:

    <?php acf_form(array(
    										'id'			=> '21',
    										'post_id'		=> 'new_post',
    										'new_post'		=> array(
    											'post_type'		=> 'recipes',
    											'post_status'	=> 'publish',
    										
    											'post_title'	=> 'Recipe Title',
    										),
    										'return' => '%post_url%?see-recipe',
    										'submit_value'  => 'Create Recipe'
    									)); ?>

    There is nothing on my functions.php but it works as expected for now. Can anyone help me to implement this taxonomy field?

    Really appreciate the attention!

  • Sorry, wrong answer, I read too fast

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.