auto_update_{$type} WordPress Filter Hook

This hook is called when a new version of WordPress is available, and can be used to trigger a plugin or theme update. This hook is called when a new version of WordPress is available. It is useful for triggering a plugin or theme update.

apply_filters( "auto_update_{$type}", bool|null $update, object $item ) #

Filters whether to automatically update core, a plugin, a theme, or a language.


Description

The dynamic portion of the hook name, $type, refers to the type of update being checked.

Possible hook names include:

  • auto_update_core
  • auto_update_plugin
  • auto_update_theme
  • auto_update_translation

Since WordPress 3.7, minor and development versions of core, and translations have been auto-updated by default. New installs on WordPress 5.6 or higher will also auto-update major versions by default. Starting in 5.6, older sites can opt-in to major version auto-updates, and auto-updates for plugins and themes.

See the ‘allow_dev_auto_core_updates’, ‘allow_minor_auto_core_updates’, and ‘allow_major_auto_core_updates’ filters for a more straightforward way to adjust core updates.


Top ↑

Parameters

$update

(bool|null)Whether to update. The value of null is internally used to detect whether nothing has hooked into this filter.

$item

(object)The update offer.


Top ↑

Source

File: wp-admin/includes/class-wp-automatic-updater.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.5.0The $update parameter accepts the value of null.
3.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.