WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 32 hours ago

Last modified 32 hours ago

#50875 closed enhancement (fixed)

Introduce a wrapper for the 'auto_update_{$type}' filter checks

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: dev-feedback has-patch needs-refresh
Focuses: Cc:

Description

Background: #50868

Looking at [48750], using the $type variable was necessary to reference the canonical name of the filter, but with the filter applied in quite a few places, that increases the chances of a conflict with an existing $type variable used elsewhere.

I think this would benefit from having a dedicated function as a wrapper for the filter, something like wp_is_auto_update_forced_for_type(), similar to wp_is_auto_update_enabled_for_type().

Attachments (1)

50875.diff (2.1 KB) - added by rebasaurus 5 weeks ago.
First attempt...let me know if this is what you were thinking you had in mind.

Download all attachments as: .zip

Change History (10)

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


7 weeks ago

#2 @SergeyBiryukov
7 weeks ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


6 weeks ago

@rebasaurus
5 weeks ago

First attempt...let me know if this is what you were thinking you had in mind.

#4 @rebasaurus
5 weeks ago

  • Keywords dev-feedback has-patch added; needs-patch removed

#5 @SergeyBiryukov
5 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#6 @garrett-eclipse
4 days ago

  • Keywords needs-refresh added

Thanks for the patch @rebasaurus, a couple notes;

  1. You'll want to update the since to 5.6.0 if it's to land in the upcoming major.
  2. Along with building the wrapper you'll want to apply it throughout core. The function should be applied to all instances of "auto_update_{$type}" as can be found in this changeset.
  3. The descriptions of the @params on the filters blocks should all align starting one space after the longer parameter name.
Last edited 4 days ago by garrett-eclipse (previous) (diff)

This ticket was mentioned in Slack in #core-auto-updates by pbiron. View the logs.


32 hours ago

#8 @SergeyBiryukov
32 hours ago

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

In 49241:

Upgrade/Install: Introduce a wrapper for the auto_update_{$type} filter checks.

This allows for cleaner checks whether auto-updates are forced for a plugin or theme.

Follow-up to [48750].

Props rebasaurus, garrett-eclipse, SergeyBiryukov.
Fixes #50875.

#9 @SergeyBiryukov
32 hours ago

In 49243:

Upgrade/Install: Restore casting $filter_payload to an object in WP_MS_Themes_List_Table::prepare_items().

Follow-up to [48750], [49241].

See #50875.

Note: See TracTickets for help on using tickets.