Skip to content

Instantly share code, notes, and snippets.

@Chrisedmo
Last active August 29, 2015 14:08
Show Gist options
  • Save Chrisedmo/802606ef0461e0f8cbc6 to your computer and use it in GitHub Desktop.
Save Chrisedmo/802606ef0461e0f8cbc6 to your computer and use it in GitHub Desktop.
WP: Clean Menu
// REMOVE JUNK FROM 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