Home › Forums › Backend Issues (wp-admin) › Replacing custom post type post title with an acf? › Reply To: Replacing custom post type post title with an acf?
stupid mistake !
So I got the 2 below hooks / filters below running fine, each returning the proper member_lastname & member_firstname value, one after the other, when I ‘publish the field set.
At this point the WP_post /Post is created, but needs to be updated with the proper values, ie.
– for the post_name a slug => member_firstname.”-“.member_firstname;
– for the post_title => member_firstname.” “.member_firstname;
add_filter('acf/update_value/name=member_lastname', 'my_acf_update_value', 10, 3); add_filter('acf/update_value/name=member_firstname', 'my_acf_update_value', 10, 3);
– how do I keep both values from the previous hooks, so that I can use them to build both the above variables ?
– do I need to build yet another hook to update the wp_post table, & “where / when” should this happen ? I guess when ACF completes the publishing / update of the wp_postmeta table ?
Agin, many thanks for your help on this
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.