Home › Forums › General Issues › Dynamic value for message field › Reply To: Dynamic value for message field
Not updating the value in the DB you’ll need to add some conditionals in your load field filter so that it is not altered when editing the field group.
add_filter('acf/load_field/name=field_name', 'alter_message');
function alter_message($field) {
$post = get_queried_object();
if (isset($post->post_type, $post->ID) && $post->post_type != 'acf-field-group') {
// alter the field
}
return $field;
}
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.