Support

Account

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.