I have modified the function start_el
in nav-menu-template.php
substituting $item->ID
with $item->title
so that the html li
elements in menu have a more readable class names. In detail, I have changed the line
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
to
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->title, $item, $args );
This makes the editing of the style.css
file for a theme easier.
I wonder if it is possible to "transfer" the change from nav-menu-template.php
to the theme (maybe functions.php
?), so that I will not be forced to modify the file every time I upgrade WP version.