Make WordPress Core

Opened 10 years ago

Closed 8 years ago

Last modified 6 years ago

#27110 closed enhancement (maybelater)

Allow filtering the plugin list in the admin

Reported by: rmccue's profile rmccue Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Plugins Keywords: has-patch
Focuses: administration Cc:


At the moment, as decided in many tickets (such as #23403), mu-plugins can't be loaded from subdirectories. This isn't a big issue, but it means that the must-use plugins screen can seem a little bare.

I'd like to add a filter to allow adding extra plugins to the screen. Patch attached.

It's almost possible to get this working as-is, but pagination will always be broken, as WP_Plugins_List_Table calls wp_redirect if the pagination doesn't seem right.

(This could also be a filter in get_mu_plugins, but it has limited use for other purposes.)

Attachments (1)

27110.diff (536 bytes) - added by rmccue 10 years ago.
Add filter to WP_Plugins_List_Table

Download all attachments as: .zip

Change History (4)

10 years ago

Add filter to WP_Plugins_List_Table

#1 @GaryJ
10 years ago

I don't want to derail Ryan's emphasis for creating this ticket, but a non-core use case I can think of straight away is for TGM Plugin Activation.

This is a set of classes that allow a theme to include a plugin (or a reference to a plugin on the .org repo) that is considered required or recommended for the theme i.e. a plugin that registers a CPT, instead of including it within the theme files. Theme Forest make a direct reference to it in their Theme Submission Requirements, so there are more than a handful of folks using it.

TGMPA currently builds it's own page that shows the referenced plugins. Being able to filter these plugin references in to the standard plugins page, with some indicator that the plugins are not yet installed (which would be a new status to consider) would potentially make the user flow for those with themes using TGMPA to be considerably smoother.

(Thomas Griffin is in the process of rewriting TGMPA into a new set of classes that accomplish the same thing with new features.)

#2 @DrewAPicture
8 years ago

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

No further interest in pursuing this in a year and a half. Closing as maybelater.

#3 @ideag
6 years ago

Could we please revisit this? It seems very weird that we have a hook to add additional links to the views line above plugin list, but that there is no clean way to make the list table to display anything but he default plugin list once you click that link.

If that was a conscious decision, to not allow plugin developers to mess with that screen, I can understand that, though it is a bit futile, as there are ways to get around that (not nice ways, but ways nonetheless). You can hook into a different hook and modify $plugins, $totals and $status WP globals to achieve that, as demonstrated here:

If this was just overlooked, I'd be happy to provide a patch for this.

Note: See TracTickets for help on using tickets.