admin管理员组

文章数量:1431406

I have 4 advanced custom fields and I would like to save each field value when it is changed on the post and not have to wait until the post is saved.

I'm using acf/save_post action. Here is my code so far:

function my_acf_save_post( $post_id ) { 
    $fields = false; 
    if( isset($_POST['acf']) ) { 
        $fields = $_POST['acf']; 
    } 
}
add_action('acf/save_post', 'my_acf_save_post', 1);

本文标签: hooksSave acf field data via acfsavepost before post is saved