Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#49977 closed defect (bug) (fixed)

Multisite: 'mu_menu_items' filter leaves empty table on Network Settings

Reported by: dlh's profile dlh Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version: 3.0
Component: Networks and Sites Keywords: has-patch has-screenshots
Focuses: multisite Cc:

Description

As a developer maintaining a multisite network, I'd like to prevent super administrators from enabling any administration menus on individual sites, such as "Plugins." I can do this with:

add_filter( 'mu_menu_items', '__return_empty_array' );

However, the Menu Settings heading and empty settings table still appear on the Network Settings screen. See the attached screenshot.

The attached patch would check for available menus after applying mu_menu_items and before rendering the markup.

Attachments (2)

49977.diff (3.3 KB) - added by dlh 5 years ago.
Screen Shot 2020-04-22 at 2.41.42 PM.png (49.1 KB) - added by dlh 5 years ago.

Download all attachments as: .zip

Change History (4)

@dlh
5 years ago

#1 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.5

#2 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 47616:

Networks and Sites: Don't display an empty Menu Settings section in network admin if there are no items.

This accounts for returning an empty array from the mu_menu_items filter.

Props dlh.
Fixes #49977.

Note: See TracTickets for help on using tickets.