Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Basically, I need to alter the info the user inputs into an advanced custom fields textbox before it is written to the database but I don't know how to grab it. I can only get it after it has been written to the meta portion of the database by using get_field().

share|improve this question

closed as off-topic by kaiser May 2 at 16:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 0 down vote accepted

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);
share|improve this answer
    
works perfectly, thanks! –  tyler Sep 24 '12 at 14:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.