Skip to content

Instantly share code, notes, and snippets.

@RiodeJaneiroo
Created October 9, 2018 10:45
Show Gist options
  • Save RiodeJaneiroo/880f4bde20bc16b4ae9aa2600f621284 to your computer and use it in GitHub Desktop.
Save RiodeJaneiroo/880f4bde20bc16b4ae9aa2600f621284 to your computer and use it in GitHub Desktop.
[Wordpress - wp nav menu] Remove class and ID from li #wordpress #wp_nav_menu
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
function my_css_attributes_filter($var) {
return is_array($var) ? array() : '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment