Home › Forums › Front-end Issues › Repeater and Flexible Fields not Saving Values from FrontEnd › Reply To: Repeater and Flexible Fields not Saving Values from FrontEnd
In your pre save post filter
/**
* Back-end creation of new candidate post
*/
add_filter('acf/pre_save_post' , 'tsm_do_pre_save_post' );
function tsm_do_pre_save_post( $post_id ) {
// Bail if not logged in or not able to post
if ( ! ( can_user_post_recipe() ) ) {
return;
}
// check if this is to be a new post
if( $post_id != 'new' ) {
return $post_id;
}
// Create a new post
$post = array(
'post_type' => 'post',
'post_status' => 'pending',
'post_title' => wp_strip_all_tags($_POST['acf']['field_559a8e6366915']), // Post Title ACF field key
'post_content' => $_POST['acf']['field_559a8e7b66916'], // Post Content ACF field key
);
$post_id = wp_insert_post( $post );
do_action( 'acf/save_post' , $post_id );
return $post_id;
}
Why are you doing do_action( 'acf/save_post' , $post_id );
? Did you read somewhere that you should add that? Because it is not in any of the documentation or tutorials on acf/pre_save_post.
Try removing that line.
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.