Home › Forums › ACF PRO › Get all values from user profile acf_form › Reply To: Get all values from user profile acf_form
Set the priority of your filter to 20 so that it runs after ACF has saved the values
add_action('acf/save_post', 'my_save_post', 20);
Then get the values and add them the same way you’d get them for a template
$body = '';
$body .= 'Field Label: '.get_field('field_name', $post_id)."\r\n";
$body .= 'field label 2:'.get_field('field_name_2, $post_id)."\r\n";
You could probably also use either get_fields() https://www.advancedcustomfields.com/resources/get_fields/ or get_field_objects() https://www.advancedcustomfields.com/resources/get_field_objects/ and use a loop to add them to the body. The main difference between a template and what you’re doing is that you need to add the values to the string rather then display them.
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.