WordPress.org

Make WordPress Core

Opened 8 weeks ago

Closed 7 weeks 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)

50868.diff (5.9 KB) - added by johnbillion 8 weeks ago.

Download all attachments as: .zip

Change History (10)

@johnbillion
8 weeks ago

#1 @johnbillion
8 weeks ago

  • Keywords has-patch added; needs-patch removed

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.

#2 @johnbillion
8 weeks ago

This needs testing to ensure the $type variable isn't overwriting one that already exists.

#3 follow-up: @SergeyBiryukov
7 weeks 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 @SergeyBiryukov
7 weeks 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.

#5 @SergeyBiryukov
7 weeks ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 48750:

Docs: Correct usage of the dynamic auto_update_{$type} filter.

This ensures that the canonical name of the filter is used in Site Health debug data, as well as on plugin and theme screens, so the developer reference site remains correct.

Props johnbillion.
Fixes #50868.

#6 @SergeyBiryukov
7 weeks ago

  • Keywords commit dev-feedback added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for the 5.5 branch.

#7 in reply to: ↑ 3 @SergeyBiryukov
7 weeks ago

Replying to SergeyBiryukov:

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().

Follow-up: #50875

#8 @whyisjake
7 weeks ago

  • Keywords dev-reviewed added; dev-feedback removed

#9 @whyisjake
7 weeks ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 48756:

Docs: Correct usage of the dynamic auto_update_{$type} filter.

This ensures that the canonical name of the filter is used in Site Health debug data, as well as on plugin and theme screens, so the developer reference site remains correct.

This brings the changes from [48750] to the 5.5 branch.

Props johnbillion.
Fixes #50868, see [48750].

Note: See TracTickets for help on using tickets.