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?
HI @elliot, and thanks for your reply.
the ‘get_field (‘member_firstname’) does not seem to recall the field, when used inside this function… the rest works perfectly :
– composing the $new_title & slug;
– update of the wp_post with $post_id, – of course W/O the “member_firstname field value…!-:
$my_post = array('ID'=> $post_id,'post_title' => $new_title,'post_name' => $new_slug ); wp_update_post( $my_post );
Another related question is how do I proceed to call this hook / function when / if the fieldset is updated (as opposed to just ‘created’) to reflect the change in member_last / firstname should these fields be changed?
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!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.— Advanced Custom Fields (@wp_acf) February 23, 2023
© 2023 Advanced Custom Fields.