Advertisement
pixel-industry

Bootstrap menu - top level menu link active

Apr 24th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. /**
  2.  * Add additional class for top level menu items
  3.  *
  4.  * @param string $item_output
  5.  * @param obj $item
  6.  * @param int $depth
  7.  * @param obj $args
  8.  * @return string
  9.  */
  10. function volcanno_top_menu_link_active($item_output, $item, $depth, $args){
  11.     if($depth == 0){
  12.         return str_replace('dropdown-toggle', 'dropdown-toggle disabled', $item_output);
  13.     }else{
  14.         return $item_output;
  15.     }
  16.    
  17. }
  18.  
  19. add_filter('walker_nav_menu_start_el', 'volcanno_top_menu_link_active', 10, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement