wp_is_auto_update_forced_for_item() WordPress Function

The wp_is_auto_update_forced_for_item() function allows you to check if an auto-update is being forced for a particular item.

wp_is_auto_update_forced_for_item( string $type, bool|null $update, object $item ) #

Checks whether auto-updates are forced for an item.


Parameters

$type

(string)(Required)The type of update being checked: 'theme' or 'plugin'.

$update

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

$item

(object)(Required)The update offer.


Top ↑

Return

(bool) True if auto-updates are forced for $item, false otherwise.


Top ↑

Source

File: wp-admin/includes/update.php

function wp_is_auto_update_forced_for_item( $type, $update, $item ) {
	/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
	return apply_filters( "auto_update_{$type}", $update, $item );
}


Top ↑

Changelog

Changelog
VersionDescription
5.6.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.