Some how this has sorted itself out and I didn’t need the trigger after all.
Ok, it looks like if I run $form_container.trigger( 'acf/setup_fields' );
it hides the fields but takes a good 1-2 seconds to do so. Any way to minimize this timedelay?
I’d like to update a post, not set it upon creation.
It looks like it was because I had the option selected that reads “Load Terms – Load value from posts terms.”
What does this value do?
Since the relationship field does an admin Ajax call to query for a post to relate to, is there a way programmatically add to the returned results or is there a way for me to create a new post and then set the relationship field to the new result?
Example:
Two forms on one page. Form A has the relationship field and makes post type 1. Form B has a form that creates a new post type 2 via Ajax so the page doesn’t reload. When a new post type 2 is created by form 2 I want to then set the relationship field in form A to this newly created post type 2 without user action.
I would need to simulate searching and setting the relationship after its created without the user actually doing so.
I am so in need of this ability. Trying to find other ways around it in the current version but what I find is outdated or not working.
I would also like to know how to set the value programmatically but using JavaScript after the page has been loaded.
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.