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!
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.