Opened 9 years ago
Closed 9 years ago
#37495 closed defect (bug) (fixed)
Restore `install_plugins_upload` action to allow replacing plugin upload form
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Plugins | Keywords: | has-patch commit dev-reviewed |
Focuses: | administration | Cc: |
Description
In WP versions up to and including 4.5, the "upload plugin" form is output by WP calling the action 'install_plugins_upload'.
As such, it's possible to replace that form (as I do in this plugin with over 3,000 active users: https://wordpress.org/plugins/upload-larger-plugins/ ) with an alternative with a remove_action() on the default action, and add_action of your alternative.
That's gone in WP 4.6 RC 1; as part of the re-arrangement of the plugin upload experience (from a tab into a slide-down), the action call (which has been presented since WP 2.7) has been removed (apparently unintentionally), replaced with a direct call to the internal WP function.
The attached patch adds it back. Since the action call is to a very short function that only outputs the HTML fragment, it has no other impact.
Attachments (6)
Change History (18)
#1
@
9 years ago
- Focuses administration added
- Keywords has-patch added
- Summary changed from Regression in WP 4.6 RC 1 - can no longer replace plugin upload form (removed action) to Restore `install_plugins_upload` action to allow replacing plugin upload form
#2
follow-up:
↓ 7
@
9 years ago
- Milestone changed from Awaiting Review to 4.6
Changed in [37221]. install_plugins_upload
comes from the dynamic install_plugins_$tab
action.
@DrewAPicture Should this action be documented as a duplicate hook?
#3
@
9 years ago
Worth noting the "upload tab" is still accessible /plugin-install.php?tab=upload
directly (there are also plugins that use it, I think) and for example when JS is off. This way, the upload tab will have 2 forms even if one of them is hidden with CSS.
@
9 years ago
Second version which prevents double-call of the action when visiting the uploads tab directly
#4
@
9 years ago
Further investigation shows that the action call to install_plugins_pre_upload had also dropped out (I was relying on this action to perform remove_action() for the WP default action). The new version of the patch - uploader-filter3.diff - restores it also.
#5
@
9 years ago
- Removes
$upload_tab_class
and add a class of the current tab to.wrap
- Provides the *_upload actions on non-upload tabs
- Prevents two upload forms on the upload tab
- Adds
display:none
to.upload-plugin-wrap
. This adds support for plugins like Upload Larger Plugins which don't have a.upload-plugin
container.
#6
@
9 years ago
"This adds support for plugins like Upload Larger Plugins which don't have a .upload-plugin container" - omitting that (which was in the form in previous WP versions) might be considered a bug in the plugin; I spotted that at the same time you were doing this, and added it! The trunk version of that plugin now has it.
#7
in reply to:
↑ 2
@
9 years ago
#8
@
9 years ago
I can confirm that with this patch - 37495.2.diff - all works as expected on the plugin I'm testing with.
#9
@
9 years ago
- Keywords commit added
37495.3.diff adds a comment to install_plugins_pre_upload
to explain why it's there.
#10
@
9 years ago
37495.3.diff looks good.
Re-add the install_plugins_upload action