编辑-对于当前版本的ACF,此答案不再准确,请参阅their documentation
使用acf_save_post
钩
function my_acf_save_post( $post_id )
{
// vars
$fields = false;
// load from post
if( isset($_POST[\'fields\']) )
{
$fields = $_POST[\'fields\'];
}
// ...
}
// run before ACF saves the $_POST[\'fields\'] data
add_action(\'acf_save_post\', \'my_acf_save_post\', 1);
// run after ACF saves the $_POST[\'fields\'] data
add_action(\'acf_save_post\', \'my_acf_save_post\', 20);