Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#54400 new enhancement

Show "Add New" title buttons on single-site Plugins/Themes pages for capable users in multisite

Reported by: johnjamesjacoby Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.0
Component: Administration Keywords: needs-patch needs-screenshots 2nd-opinion
Focuses: multisite Cc:

Description

On multisite installations, when viewing a single site's admin area – as a Network Admin (or otherwise capable user) – none of the "Add New" links for Plugins & Themes are displayed.

I would like to re-add these buttons back, but have them link to the correct Network Admin pages.

At first scan, not having these buttons on single sites makes sense because it is not possible to add a new plugin or theme at the site level.

After having this be the default behaviour since WordPress 3.0, I think it could be improved.

Conceptually, the problem isn't that installing plugins or themes is no longer possible in multisite, it is simply that the location and capabilities required to do so are elevated from single-site.

If the currently logged in user can access those locations and has the capability to perform the task, it would be convenient to re-show these buttons but link them to the network URLs.

To replicate:

  • Log into a multisite installation as a Network Admin
  • Visit /wp-admin/plugins.php
  • Notice there is no "Add New" link or button anywhere
  • The only UI path to add a plugin is: Admin Bar > My Sites > Network Admin > Plugins > Add New

(Themes has the same above issue & relative navigation...)

Attachments (1)

54400.diff (1.5 KB) - added by johnjamesjacoby 3 months ago.
Proof of concept…

Download all attachments as: .zip

Change History (4)

#1 @henry.wright
3 months ago

Would you have the button not display for users without the capability or would you use the disabled attribute to disable the button?

Either way, +1 for making it easier for super admins to add themes and plugins.

#2 @johnjamesjacoby
3 months ago

In my imagination, the button remains hidden for non-capable users.

@johnjamesjacoby
3 months ago

Proof of concept...

#3 @henry.wright
3 months ago

54400.diff reviewed. It does the job nicely

Note: See TracTickets for help on using tickets.