Home › Forums › Bug Reports › Frontend Form Issues: pre_save_post & save_post › Reply To: Frontend Form Issues: pre_save_post & save_post
It is pretty weird huh? I’m absolutely weirded out by this one…
Okay, the save_post action is commented out and the following debugging statements were added to acf_form_head
(results below);
function acf_form_head()
{
// global vars
global $post_id;
// verify nonce
if( isset($_POST['acf_nonce']) && wp_verify_nonce($_POST['acf_nonce'], 'input') )
{
var_dump($post_id); // OUTPUT: NULL
// $post_id to save against
$post_id = $_POST['post_id'];
var_dump($post_id); // OUTPUT: string(3) "new"
// allow for custom save
$post_id = apply_filters('acf/pre_save_post', $post_id);
var_dump($post_id); // OUTPUT: NULL
die();
// save the data
do_action('acf/save_post', $post_id);
// ...
}
// ...
}
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.