Home Forums Front-end Issues understanding acf_form Reply To: understanding acf_form

  • – First of all, WHY I have to do all this, just because I use taxonomy? Why don’t you better integrate taxonomy in ACF(Pro)?

    Because ACF has some limitations, an these limitations are directly related to limitation in WP. ACF does not change the way WP works (even if it looks like it does) it only enhances what WP can already do and what is possible for anyone to do using core WP function if they wanted to do all the work themselves.

    – You said

    You also mentioned trying to create a field group that was conditional based on a field in another field group, also not possible, either front or back end

    but it works for me on backend (not in front).

    I seriously doubt that you have a ACF Field Group that only appears if a field in another ACF Field Group is a certain value unless you created the JavaScript to do it. You may have an ACF Field Group that appears if a certain term in the WordPress Taxonomy Meta Box is selected, but this is not the same as an ACF Taxonomy Field. The ACF Taxonomy Field and the WP Taxonomy Meta Box are two entirely different things that work in different ways that produce similar results. I don’t think that I can explain this any better or in any other way.

    – …and I still don’t understand why I have to specify ‘field_groups’ for acf_form. What’s the aim of location rules if it doesn’t work ?

    The reason that you need to do this is because you want to create new posts. If you wanted to show the current values of the current post or page and allow someone to update those values then yes, the location rules will work. But since your intention is to create a new post in a different post type than the post where the form is shown on the front end, setting the location of the field group to appear on both you template page where you want the form and on the post type where you want to create the new post, is pointless.

    you use wp_set_post_terms and it works whereas codex said “For a taxonomy on a custom post type use wp_set_object_terms()

    A post is a post is a post, even a post in a custom post type is just another post that has all of the same properties. Anything that works on the ‘post’ post type will work on a post in a custom post type.