Support

Account

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);