Hi!
I’d like to add a custom function just before my acf_form is sent. is that possible?
More details :
The user has the possibility to edit his page on my platform using acf_form. What i wanna do, is to add a function just before he update his page so i can add a validation system.
So basically, save the form data, send request to admin, view data, approve data, then publish.
So, is there a hook i could use to add a function just before the publish?
<?php
$edit_post = array(
‘fields’ => array(
’boutique_cover’,
’boutique_logo’,
’boutique_name’,
’boutique_url’,
’boutique_desc’,
’boutique_short_desc’,
’boutique_products’,
’boutique_custom_CTA’,
’boutique_social_buttons’,
’boutique_card_img’,
),
‘post_id’ => $current_boutique_id,
‘post_status’ => ‘publish’,
‘form’ => true,
‘post_title’ => false,
‘return’ => ‘%post_url%’,
‘html_submit_button’ => ‘<input type=”submit” class=”button edit-boutique-submit” value=”Enregistrer les modifications” />’,
);
if ($current_boutique_id) {
acf_form( $edit_post );
}; ?>