Skip to main content

Edit - This answer is no longer accurate for the current version of ACF, see their documentationtheir documentation

Use the acf_save_post hook. See Hooks & Filters in Advanced Custom Fields documentation.

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);

Edit - This answer is no longer accurate for the current version of ACF, see their documentation

Use the acf_save_post hook. See Hooks & Filters in Advanced Custom Fields documentation.

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);

Edit - This answer is no longer accurate for the current version of ACF, see their documentation

Use the acf_save_post hook.

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);
added 158 characters in body
Source Link
Milo
  • 78.9k
  • 4
  • 127
  • 168

Edit - This answer is no longer accurate for the current version of ACF, see their documentation

Use the acf_save_post hook. See Hooks & Filters in Advanced Custom Fields documentation.

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);

Use the acf_save_post hook. See Hooks & Filters in Advanced Custom Fields documentation.

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);

Edit - This answer is no longer accurate for the current version of ACF, see their documentation

Use the acf_save_post hook. See Hooks & Filters in Advanced Custom Fields documentation.

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);
Source Link
Milo
  • 78.9k
  • 4
  • 127
  • 168

Use the acf_save_post hook. See Hooks & Filters in Advanced Custom Fields documentation.

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);