WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#33536 closed defect (bug) (invalid)

Adding new section in Menus panel

Reported by: wenthemes Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Customize Keywords: reporter-feedback
Focuses: ui, administration Cc:

Description

When I was trying to add extra fields Menus panel, I found that new sections are pushed under menu list. I expect new section kept under Add a Menu.

In the attached screenshot I have added Sample Section in the panel.

Attachments (1)

section-in-menu-panel.png (15.3 KB) - added by wenthemes 5 years ago.

Download all attachments as: .zip

Change History (7)

#1 @atomicjack
5 years ago

  • Keywords 2nd-opinion reporter-feedback added

You want your new menu section to be under the 'Add a Menu' button?

That would make no sense - as the menu is then split into two parts...

#2 @wenthemes
5 years ago

  • Keywords reporter-feedback removed

I was trying to add some extra controls like Enable Sticky, Menu Alignment, etc fields in the Section. I am not trying to add default WordPress menu. It will be automatically in the list. I was expecting my new section like currently Menu Locations is separated.

#3 @westonruter
5 years ago

  • Keywords reporter-feedback added; 2nd-opinion removed

@wenthemes What priority are you registering the new section with?

#4 @westonruter
5 years ago

@wenthemes: It would be very helpful if you attached a plugin that demonstrated what you're trying to do, and which demonstrates the problem.

#5 @wenthemes
5 years ago

I have created a gist for sample code. Hope it will be helpful to reproduce. https://gist.github.com/wenthemes/3e902bd90c7e88e81feb

#6 @celloexpressions
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

There is no core bug here.

Please see the documentation regarding the use of priorities when registering sections. For menus, each menu is given a sequentially-incremented numeric priority. The add a menu section has priority 999. So, registering a panel without a priority, resulting in the default priority of 160, will put that section with the group of menus. Using a higher priority than the add button will put your section at the very bottom and a priority of less than 5 should put it above the menu locations section (priority 5). If you want visual separation from the menus list, you can target your section with CSS like the menu locations section has.

Note: See TracTickets for help on using tickets.