Home › Forums › ACF PRO › Warnings with clean install of ACF Pro 5.0.9 and WP 4 › Reply To: Warnings with clean install of ACF Pro 5.0.9 and WP 4
Hi guys
I’ve got a fix for the issue and if you have time, please replace the following function into the api-helpers.php file:
function acf_verify_nonce( $nonce, $post_id = 0 ) {
// vars
$r = false;
// note: don't reset _acfnonce here, only when $r is set to true. This solves an issue caused by other save_post actions using this function with a different $nonce
// check
if( isset($_POST['_acfnonce']) ) {
// verify nonce 'post|user|comment|term'
if( is_string($_POST['_acfnonce']) && wp_verify_nonce($_POST['_acfnonce'], $nonce) ) {
$r = true;
// remove potential for inifinite loops
$_POST['_acfnonce'] = false;
// if we are currently saving a revision, allow its parent to bypass this validation
if( $post_id && $parent = wp_is_post_revision($post_id) ) {
// revision: set parent post_id
$_POST['_acfnonce'] = $parent;
}
} elseif( $_POST['_acfnonce'] === $post_id ) {
$r = true;
// remove potential for inifinite loops
$_POST['_acfnonce'] = false;
}
}
// return
return $r;
}
Please also let me know if this solves the issue for you
Thanks
E
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!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.