Created
January 17, 2014 19:45
-
-
Save eccentricpixel/8480112 to your computer and use it in GitHub Desktop.
Adds a span tag of the TITLE attribute in the output of Wordpress menus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('walker_nav_menu_start_el', 'description_in_nav_el', 10, 4); | |
function description_in_nav_el($item_output, $item, $depth, $args) | |
{ | |
return preg_replace('/(<a.*?>[^<]*?)</', "<span>{$item->attr_title}</span>" . '$1' . "<", $item_output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment