Opened 4 years ago
Closed 4 years ago
#50868 closed defect (bug) (fixed)
Correct usage of the non-dynamic auto_update_plugin and auto_update_theme hooks
Reported by: | johnbillion | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | 5.5 |
Component: | Upgrade/Install | Keywords: | has-patch commit dev-reviewed |
Focuses: | docs | Cc: |
Description
The auto_update_plugin
and auto_update_theme
hooks are used in a few places in core, but the canonical name for both of these is "auto_update_{$type}"
. This means the corresponding comment above each one is not correct.
We should change these instances to the dynamic name so the developer reference site remains correct.
In addition, this is a filter not an action so the comments need updating in a few places.
Milestoning for 5.5 so we ensure all the docs are as accurate as possible now that user-controllable plugin and theme auto updates are a feature.
Attachments (1)
Change History (10)
#2
@
4 years ago
This needs testing to ensure the $type
variable isn't overwriting one that already exists.
#3
follow-up:
↓ 7
@
4 years ago
Looking at the patch, this would probably benefit from having a dedicated function as a wrapper for the filter, e.g. wp_is_auto_update_forced_for_type()
, similar to wp_is_auto_update_enabled_for_type()
.
But that's something for a future release, 50868.diff should be fine for now. Haven't tested yet though, working on that now.
#4
@
4 years ago
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
As far as I can tell, the $type
variable doesn't clash with any existing ones. Should be good to go.
#6
@
4 years ago
- Keywords commit dev-feedback added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for the 5.5 branch.
Patch that also updates the docs for the
"auto_update_{$type}"
filter to add a full version of the possible filter names, which means that searching the Developer Reference site for any of those filter names will return this filter in the search results.