Home › Forums › General Issues › Update_field not working on post update › Reply To: Update_field not working on post update
@hube2 Thanks for responding 🙂
I added the following:
$field = get_field_object('notification_record');
var_dump($field["key"]);
exit;
which gave me ‘field_57cee83c43f92’ as the key
so I updated my code here and it’s still not saving 🙁
function do_something_on_save( $new_status, $old_status, $post ) {
//echo get_the_ID(); //returns 13
//exit;
//$field = get_field_object('notification_record');
//var_dump($field["key"]); //returns 'field_57cee83c43f92'
//exit;
update_field(
'field_57cee83c43f92',
'checking',
13
);
}
add_action( 'transition_post_status', 'do_something_on_save', 10, 3 );
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.