Home › Forums › General Issues › Menu Item custom radio button field show results based on value › Reply To: Menu Item custom radio button field show results based on value
I recently did something similar, but then scrapped it so I’m going by memory here. But you can add classes to the menu items in the filter. At this point I can’t give you exact details. I do remember that one of the properties of each menu item is a list of classes to be applied to that item.
I would start by seeing what is there to be used.
add_filter('wp_nav_menu_objects', 'my_wp_nav_menu_objects', 10, 2);
function my_wp_nav_menu_objects($items, $args) {
echo '<pre>'; print_r($items); echo '</pre>';
return $items;
}
This may lead you to your answer. If not post what this outputs and I will see if I can help you with it.
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!
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future.
— Advanced Custom Fields (@wp_acf) January 6, 2023
https://t.co/HahJUCcyH4
© 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.