get_fields in the save_post hook
-
Hello,
I nhave a acf that is filter to be filled after a specific category is selected.
I need to get this field data on wp save_post hook, I’d even try the wp_after_insert_post hook, booth withouth succes.Searching answers I’d find a lot of references to the ‘acf/save_post’ hook.
I just try to get what data this hook have but with no success either.The code to test the acf/save_post hook on my functions.php theme file:
function test_acf($post_id) { error_log( 'Saved post ID : ' . $post_id, false); error_log( var_export($_POST, true), false ); //If you want to log what got saved to the database error_log( var_export(get_post($post_id), true), false ); } add_action('acf/save_post', 'test_acf', 20);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_fields in the save_post hook’ is closed to new replies.