Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I added descriptions to my menus using this post, Menu items description?. However I need to be able to use html tags and WordPress is stripping them out. Can anyone help?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

You can remove the filter by adding this to your functions.php file:

remove_filter('nav_menu_description', 'strip_tags');
share|improve this answer
add comment

In new wordpress we need add some mojo:

remove_filter('nav_menu_description', 'strip_tags');
add_filter( 'wp_setup_nav_menu_item', 'cus_wp_setup_nav_menu_item' );
function cus_wp_setup_nav_menu_item($menu_item) {
                $menu_item->description = apply_filters('nav_menu_description',  $menu_item->post_content );
                return $menu_item;
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.