Home › Forums › Front-end Issues › profile_update hook and acf frontend form › Reply To: profile_update hook and acf frontend form
acf/save_posts is run on any page where custom field are shown and only when there are acf fields shown and submitted.
If acf/save_post is not running then there are not acf fields being submitted.
when ACF passes the $post_id value to your filter it will be in the form
"user_{$user_id}"
in order to use standard WP function you will need to extract the user ID
function whatever_your_function_name_is($post_id) {
// see if the post ID is for a user
if (strpos($post_id, 'user_') !== 0) {
// string does not start with user_
// bail
return;
}
$user_id = intval(substr($post_id, 5));
// your code to update user here
}
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.