Advertisement
Guest User

Untitled

a guest
Mar 11th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. add_filter( 'walker_nav_menu_start_el', 'generate_tertiary_nav_dropdown', 10, 4 );
  2. function generate_tertiary_nav_dropdown( $item_output, $item, $depth, $args )
  3. {
  4. // If we're working with the primary or secondary theme locations
  5. if ( 'tertiary' == $args->theme_location ) {
  6. // If a dropdown menu is detected
  7. $dropdown = ( in_array( 'menu-item-has-children', $item->classes ) || in_array( 'page_item_has_children', $item->classes ) ) ? true : false;
  8. if ( $dropdown ) :
  9. // Add our arrow icon
  10. $item_output = str_replace( $args->link_after . '</a>', $args->link_after . '<span role="button" class="dropdown-menu-toggle" aria-expanded="false"></span></a>', $item_output );
  11. endif;
  12. }
  13.  
  14. // Return the output
  15. return $item_output;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement