Take the 2-minute tour ×

I'm creating custom wordpress theme. How can I enable "Description" metabox for menu items (on nav-menu page) by default programmatically?

share|improve this question
"WordPress already comes with the option to add a description to each menu item, but it is hidden by default." See: kriesi.at/archives/… –  adrian7 Jan 6 '13 at 13:31
adrian7, how can I show this metabox by default? –  Stanislau Ladutska Jan 6 '13 at 13:36
I will post an answer when I find out. –  adrian7 Jan 6 '13 at 13:42
Thank you, adrian7! –  Stanislau Ladutska Jan 6 '13 at 13:47
add comment

2 Answers

up vote 0 down vote accepted

Remove the description from the user meta value managenav-menuscolumnshidden:

add_filter( 'manage_nav-menus_columns', 'enable_nav_menu_description_by_default' );

function enable_nav_menu_description_by_default( $columns )
    $desc_key = 'managenav-menuscolumnshidden';
    $hidden   = get_user_option( $desc_key );
    $user_id  = wp_get_current_user()->ID;

    if ( ! $hidden )
            array ( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn' )
    elseif ( FALSE !== ( $key = array_search( 'description', $hidden ) ) )
        unset( $hidden[ $key ] );
        update_user_option( $user_id, $desc_key, $hidden );

    return $columns;
share|improve this answer
Thank you, toscho♦ ! –  Stanislau Ladutska Jan 6 '13 at 14:51
add comment

If you're looking to output the menu description here is a useful tutorial using WordPress Walker Menu class to enchance the menu Wordpress Walker Menu Tutorial

share|improve this answer
Thank you nackle for your answer. But I need a little different thing. I need to enable metabox in admin panel, on nav-menus screen. –  Stanislau Ladutska Jan 6 '13 at 13:23
@nackle your answer is not related to the question. –  adrian7 Jan 6 '13 at 13:34
It may not be related the the original question, but a search on here for "nav description" brought this post as the first result. Which in turned answered the question that I came here with on how to display nav descriptions. Upvote for that. –  AndyWarren Apr 6 '13 at 15:36
add comment

Your Answer


