mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +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:
@@ -229,11 +229,10 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
'requires_php' => '',
|
||||
'compatibility' => new stdClass(),
|
||||
);
|
||||
|
||||
$filter_payload = (object) array_merge( $filter_payload, array_intersect_key( $plugin_data, $filter_payload ) );
|
||||
|
||||
$type = 'plugin';
|
||||
/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
|
||||
$auto_update_forced = apply_filters( "auto_update_{$type}", null, $filter_payload );
|
||||
$auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload );
|
||||
|
||||
if ( ! is_null( $auto_update_forced ) ) {
|
||||
$plugin_data['auto-update-forced'] = $auto_update_forced;
|
||||
|
||||
Reference in New Issue
Block a user