Support

Account

Home Forums Backend Issues (wp-admin) Send acf_form data to external api

Helping

Send acf_form data to external api

  • Hello everyone,

    i created a user profile using acf_form.

    This is my base code, if it helps:

    <?php $options = array(
    'post_id' => 'user_'.$current_user->ID,
    'field_groups' => array(552977),
    'form' => true, 
    'return' => add_query_arg( 'updated', 'true', get_permalink() ), 
    'html_before_fields' => '',
    'html_after_fields' => '',
    'submit_value' => 'Aggiorna profilo' 
    );
    acf_form( $options );
    ?>

    I would like to know if it is possible to send this data to an external API, every time the user updates the fields

  • Use an acf/save_post action with a priority of <10.

    The new values will be in $_POST['acf'] and the old values will be in the database and you can get them using get_field(). Compare the values and then connect to your external API to send the information if there are differences.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.