WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 5 weeks ago

#41809 new defect (bug)

Default setting for menu locations should be to use page structure (no custom menu) with option for no menu

Reported by: anmari Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9
Component: Menus Keywords: reporter-feedback
Focuses: Cc:

Description

The menu customiser default setting for first menu location should to use the page structure as is WITHOUT having to create a custom menu.

IE the way things used to be before the customiser came along.

If one wants 'no menu' then one should be able to say so (apparently twenty-seventeen theme does not default to page structure for menu as it wants to allow for 'no menu' https://core.trac.wordpress.org/ticket/39056#comment:4 )

This forces people who just want the page structure into double maintenance, which seems a bit ridiculous.

Ideally the page structure should be the default if there is no custom menu and if people are happy with that, then they need do no further work - like it used to be. If they want 'no menu' or 'custom menu' then they choose 'no menu' or create a menu.

This could perhaps be achieved by making the default for the first menu location be a 'use page structure' option. One could then still choose 'no menu'. This would also get around the problem of people having to create a menu just to mimic the page structure, and then continually maintain it when they add subpages - two steps where there used to be one.

The way things are now, complexity has been added to simple websites that don't have complex menu structures - a backward step.

Change History (2)

#1 @welcher
6 weeks ago

  • Keywords reporter-feedback added

@anmari thank for the ticket!

Can you confirm if this limited to the way twenty-seventeen handles menus? If so, then I based on the linked comment above, it seems like a design decision.

#2 @anmari
5 weeks ago

Agree that it was a design decision of themes 2017, 2016, 2015 to offer a 'no menu' option if there was no custom menu. Doing that by using an empty fallback_cb argument means they lost the default of the 'menu from page structure' option. Did they realise the impact for those who wanted simple menus, possibly not?

But this makes it much harder for those that do just want the default page based menu. Folks new to wordpress must surely be gobsmacked when trying out themes like twenty-seventeen and finding that they have to keep recreating their page structure in the menu system. So yes while the theme's could possibly find a way to make this a setting, because of it's impact, I think this should definitely be a setting that wordpress core should facilitate. Possibly an option somewhere sensible. Maybe in the customiser at high level? or in the menu section?
Options:
1) default: use wp page structure for the 'main' menu,
2) use custom menus
3) no menu for main location.

I managed code to force the default page menu back. I had a look to have this controlled by a setting in the customizer but I'm not that familiar with customizer, so did not find somewhere easily to add the above 3 way option.

It seems very wrong that one should have to add back simplicity that used to be there.


For others who may end up here:

Code to force default wp page menu back to avoid having to recreate page structure in custom menu for themes following twenty-seventeen, twenty-sixteen, twenty-fifteen styles. WARNING This does it for all menus at moment, ideally should only do for main menu:

<?php
function amr_wp_page_menu_load ($args ){
        if (empty($args['fallback_cb']))  
                $args['fallback_cb'] = 'wp_page_menu');
        return $args;   
}

function amr_wp_page_menu_init() {
        add_filter('wp_nav_menu_args',          'amr_wp_page_menu_load', 1); 
}

add_action ('plugins_loaded', 'amr_wp_page_menu_init',1); 


Last edited 5 weeks ago by anmari (previous) (diff)
Note: See TracTickets for help on using tickets.