/ Published in: PHP
This function, when placed in a theme's 'functions.php' file will insert a custom id attribute into the '
For example, if a post category has the name "This & That", it will generate an HTML id attribute as "this-that".
This version replaces spaces and ampersands - other characters can be added to the "strreplace" functions to filter out other characters that may exist in the "$itemdetails>title" property.
Expand |
Embed | Plain Text
add_filter('nav_menu_item_id','change_nav_menu_id',10,2); function change_nav_menu_id($current_id,$item_details){ global $menu_counter; return $id_slug; }
You need to login to post a comment.
