Home › Forums › Front-end Issues › Best way to associate form submittal with specific form in acf/save_post action › Reply To: Best way to associate form submittal with specific form in acf/save_post action
I ended up changing this to a pre-save filter (I needed to change some of the values) and I looked for specific custom fields and called my mail functions from there.
function custom_acf_pre_save_post($post_id) {
if($_POST['acf']['field_5a0dc6820fd89'] && ($_POST['acf']['field_5a0dc6820fd89'] != get_field('custom_field', $post_id)){
//wp_mail code here...
}
return $post_id;
}
add_filter('acf/pre_save_post' , 'custom_acf_pre_save_post', 10, 1);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.