Hi all !
I’m trying to find a solution to this issue :
So, first, my request apply to the creation of a custom post type post in front-end.
On my application, i can navigate through the taxonomy hierarchy of this custom post type (ie : category) .
Imagine I’m located to the the taxonomy child term country->towns … I would be at http://www.mysite/country/towns and WP would display all the custom post posts related to this taxonomy terms …
I would like to display on this page a form that would create a custom post type post in relation to the taxonomy navigation where i’m … So country->towns
Is there a way to display that kind of ACF form when located somewhere in the taxonomy hierarchy ?
thanks a lot !
François
For this you would use an acf/pre_save_post filter to create the new post.
http://www.advancedcustomfields.com/resources/acf-pre_save_post/
Then get the current term id for the page being loading and either set the taxonomy term for the post by using either standard WP function of using the ACF update field function to set a taxonomy field.
https://codex.wordpress.org/Function_Reference/wp_set_post_terms
http://www.advancedcustomfields.com/resources/update_field/
Thanks @hube2 , it makes the trick 😉
regards !
François