#49686 closed feature request (fixed)
Add hook_extra parameter to upgrader_pre_download filter
Reported by: | obliviousharmony | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | minor | Version: | 5.4 |
Component: | Upgrade/Install | Keywords: | has-patch has-dev-note |
Focuses: | Cc: |
Description
Hello,
In trying to customize the no_package
error for a plugin update, I came across the upgrade_pre_download
filter as a really good fit. The only problem with this filter is that it does not contain any information except the path to the package (which is useless in my case as its an empty string) and the upgrader instance. It looks like most of the filters in the WC_Upgrader
class are passed the hook_extra
argument. I propose we add the parameter to the upgrader_pre_download
filter, which does include a plugin
key during upgrades!
Change History (19)
This ticket was mentioned in PR #198 on WordPress/wordpress-develop by ObliviousHarmony.
5 years ago
#1
This ticket was mentioned in Slack in #core by sergey. View the logs.
5 years ago
This ticket was mentioned in Slack in #core by obliviousharmony. View the logs.
4 years ago
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
4 years ago
#7
@
4 years ago
@SergeyBiryukov IS this one still doable with Beta 1 landing in a few days? What else is needed to move this one forward?
#8
@
4 years ago
- Keywords needs-dev-note added
Since this changes the filter signature, marking this for a call out on the Misc Dev Note.
#9
@
4 years ago
- Owner changed from obliviousharmony to desrosj
- Status changed from assigned to reviewing
#10
@
4 years ago
- Keywords needs-refresh added
@obliviousharmony Thanks for this! I just reviewed the PR over on GitHub with some feedback.
#11
@
4 years ago
Thanks for the feedback! I've gone ahead and flattened the parameter. For future reference, when responding to a ticket after I've addressed feedback, would I want to remove the needs-refresh
keywork?
ObliviousHarmony commented on PR #198:
4 years ago
#12
Thanks for the feedback, I've flattened the array!
#13
@
4 years ago
- Keywords needs-refresh removed
Thanks! I'll take a look shortly and try to get this in for 5.5.
Ya, that works. There is currently no syncing for labels or anything between GitHub and Trac. I personally try to keep the Trac ticket updated to reflect the status of the ticket so there is less back and forth!
ObliviousHarmony commented on PR #198:
4 years ago
#16
Thanks for the feedback! I've gone ahead and flattened the parameter. No need to be so forward-looking :)
ObliviousHarmony commented on PR #198:
4 years ago
#17
Thanks for the feedback! I've gone ahead and flattened the parameter. No need to be so forward-looking :)
#19
@
4 years ago
- Keywords has-dev-note added; needs-dev-note removed
This received a call out in the Miscellaneous Developer Changes in 5.5 dev note: https://make.wordpress.org/core/2020/07/29/miscellaneous-developer-focused-changes-in-wordpress-5-5/.
This adds a parameter to the
upgrader_pre_download
filter that can be used to identify some information about the upgrade. The specific use-case this is being added for is so that we can use theplugin
key to figure out which plugin is being updated.Trac ticket: https://core.trac.wordpress.org/ticket/49686