hooks - Save acf field data via acfsave_post before post is saved

admin2025-04-25  8

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);
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745581320a308179.html

最新回复(0)