WordPress.org

Ready to get started?Download WordPress

Ideas

wp_nav_menu string parameters defaulting when you pass empty string or false

  1. Gavrisimo
    Member

    12345

    If you try to use wp_nav_menu like this:

    wp_nav_menu(
    	array(
    		'menu' => 'Main menu',
    		'container' => 'nav',
    		'container_class' => ''
    	)
    );

    Container class is going to be the default one - menu-{menu slug}-container.

    The same thing is happening for every string parameter in wp_nav_menu.

    My idea is this:

    1. if you pass empty string like this '' - nothing gets printed out.
    2. same thing should happen if you pass false for any given argument

    The thing is, this already works for container. If you pass '' or false - your menu don't have container element.

    So with this you are only giving same functionality to every parameter in wp_nav_menu.

    Posted: 3 years ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    3 Votes
  • Status

    This idea is under consideration