AI Verified

Name

Clear navigation classes

About

Remove classes and ids from li in navigation

Language

PHP

Rating

Voted: 0 by 0 user(s)

Codevault

livenetworks

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Snippet Source:

https://wordpress.stackexchange.com/questions/12784/wp-nav-menu-remove-class-and-id-from-li

History

Last modified:

24/12/2022

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Clear navigation classes

 
                    
1add_filter('nav_menu_item_id', 'clear_nav_menu_item_id', 10, 3);
2function clear_nav_menu_item_id($id, $item, $args) {
3 return "";
4}
5 
6add_filter('nav_menu_css_class', 'clear_nav_menu_item_class', 10, 3);
7function clear_nav_menu_item_class($classes, $item, $args) {
8 return array();
9}

0

Related Snippets

Please see some snippets below related to this snippet..

General

Unverified

0

sTest

Added: 4 days ago

Last Updated: 4 days ago

test

General

Unverified

0

CountDown Timer

Added: 1 year ago

Last Updated: 1 year ago

This is a JavaScript function that creates a countdown timer for a web page using data attributes and local storage.

General

AI Verified

0

Remove Google Fonts Wordpress

Added: 1 year ago

Last Updated: 1 year ago

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Security

AI Verified

1

403 Response Header on Login Error

Added: 1 year ago

Last Updated: 1 year ago

Respond with HTTP Response Code 403 on wrong user/password. This helps <abbr title="Intruder Detection System">IDS</abbr>/<abbr title="Intruder Prevention System">IPS</abbr> to block the attacker.

General

AI Verified

0

Clear navigation classes

Added: 1 year ago

Last Updated: 1 year ago

Remove classes and ids from li in navigation