Opened 11 years ago
Closed 9 years ago
#24209 closed enhancement (worksforme)
Install Themes/Plugins Custom Page Hooks
Reported by: | amereservant | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5.1 |
Component: | Administration | Keywords: | |
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:
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)
Change History (4)
#1
@
11 years 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
Filter Hooks for Plugins and Themes