-
-
Save billerickson/f1de0f5954ed64c69ef04e88fcd251c3 to your computer and use it in GitHub Desktop.
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
<?php | |
function be_add_description( $item_output, $item ) { | |
$description = $item->post_content; | |
if (' ' !== $description ) | |
return preg_replace( '/(<a>[^<]*?)</', '$1' . '' . $description . '<', $item_output); | |
else | |
return $item_output; | |
} | |
add_filter( 'walker_nav_menu_start_el', 'be_add_description', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment