mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@49241 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1045,6 +1045,22 @@ function wp_is_auto_update_enabled_for_type( $type ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether auto-updates are forced for an item.
|
||||
*
|
||||
* @since 5.6.0
|
||||
*
|
||||
* @param string $type The type of update being checked: 'theme' or 'plugin'.
|
||||
* @param bool|null $update Whether to update. The value of null is internally used
|
||||
* to detect whether nothing has hooked into this filter.
|
||||
* @param object $item The update offer.
|
||||
* @return bool True if auto-updates are forced for `$item`, false otherwise.
|
||||
*/
|
||||
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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the appropriate auto-update message to be displayed.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user