Home › Forums › Add-ons › Options Page › Dynamically add message based on another field value › Reply To: Dynamically add message based on another field value
remove ‘option’ from here
this
$canb_name = get_sub_field('canb_notification_bar_name','option');
should be
$canb_name = get_sub_field('canb_notification_bar_name');
I’m not sure that is causing your error, but that’s the only thing I can see wrong. For some reason your code is causing an infinite loop.
Also, you should be using the acf/prepare_field hook to modify the field message. While acf/load_field can be used here it can have unintended side effects.
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN
— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.