Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JodiWarren/4731039 to your computer and use it in GitHub Desktop.
Save JodiWarren/4731039 to your computer and use it in GitHub Desktop.
add_filter( 'walker_nav_menu_start_el', 'gt_add_menu_item_description', 10, 4);
function gt_add_menu_item_description( $item_output, $item, $depth, $args ) {
$desc = __( $item->post_content );
return preg_replace('/(<a.*?>[^<]*?)</', '$1' . "<small class=\"nav-desc\">{$desc}</small><", $item_output);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment