WordPress.org

Make WordPress Core

Opened 12 months ago

Last modified 12 months ago

#24209 new enhancement

Install Themes/Plugins Custom Page Hooks

Reported by: amereservant Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5.1
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

Upon trying to add a custom page to the Plugins > Add New section for private plugins, I realized there wasn't a hook that allowed overriding the plugin_api call.

The custom tab on the page could easily be added via the install_plugins_tab filter, but in the class-wp-plugin-install-list-table.php class method prepare_items(), there isn't a hook to override the api call.

I checked the functions for the themes and it's the same thing, so I've added the patches containing the proposed filters for both classes in order to help future customization of WordPress by developers.

Here's an example of the custom tab and the desired results via the hooks in a plugin:

http://i.imgur.com/iF9gbMf.png

These filters can also be used to prohibit clients from adding 3rd-party plugins for security & performance reasons and even limit them to only using a private Repository API.

Thanks!

Attachments (1)

24209.patch (889 bytes) - added by amereservant 12 months ago.
Filter Hooks for Plugins and Themes

Download all attachments as: .zip

Change History (3)

amereservant12 months ago

Filter Hooks for Plugins and Themes

comment:1 SergeyBiryukov12 months ago

I realized there wasn't a hook that allowed overriding the plugin_api call.

Indeed. There are filters in plugins_api() and themes_api(), but they are not helpful here, since the API call is not performed at all for custom tabs due to the return in line 91:
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/includes/class-wp-plugin-install-list-table.php#L86

comment:2 SergeyBiryukov12 months ago

  • Component changed from Upgrade/Install to Administration
Note: See TracTickets for help on using tickets.