Home › Forums › Backend Issues (wp-admin) › Update field in category by functions.php on category save? › Reply To: Update field in category by functions.php on category save?
You should use the acf/save_post hook with a priority > 10
function overwrite_ratings_category($post_id){
if (is_string($post_id) && substr($post_id, 0, 5) == 'term_') {
update_field('field_630dbc7cf3fdd', '432', $post_id);
}
}
add_action('acf/save_post','overwrite_ratings_category');
This might change depending on what type of field you are trying to update. What type of field are you trying to update?
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.