Home › Forums › ACF PRO › Front end form,how to change post_title and post_content properties › Reply To: Front end form,how to change post_title and post_content properties
As @Jonathan said above you just need hook acf/pre_save_post
action to save custom title and content field into post title and content field. See sample code below
Just replace custom field keys below with specific field keys from field group.
/**
*
* Saving Custom fields into post fields acf_forms
*
*/
function acf_review_before_save_post($post_id) {
if (empty($_POST['acf']))
return;
$_POST['acf']['_post_title'] = $_POST['acf']['field_577ba2a05bb54'];
$_POST['acf']['_post_content'] = $_POST['acf']['field_577ba2b15bb55'];
return $post_id;
}
add_action('acf/pre_save_post', 'acf_review_before_save_post', -1);
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.