Home › Forums › Backend Issues (wp-admin) › Hook to be executed if a value is changed, removed or added › Reply To: Hook to be executed if a value is changed, removed or added
Hi John,
it’s a field that is updated with the value of a field in an other CPT.
therefore I use the post id store in an object relation field.
CPT Album
– Title (album name)
– Artist
– Lenght
– number of title
– genre …
CPT Review
– Title (Review sentence)
– Album (object relation field pointing to CPT album)
– Artist (updated from Albumn CPT through the object relationship field Album with Artist)
function acf_review_album_band_update( $field ) {
$field = get_field('album_band',get_field('review_album'));
return $field;
}
add_filter('acf/update_value/name=review_album_band', 'acf_review_album_band_update');
it works, but it updates the artist name only when I publish, any chance to have something more dynamic ?
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.