$mock_theme =
(object) array
( 'theme' => 'a-fake-theme',
'new_version' => '9.9',
'url' => 'https://wordpress.org/themes/a-fake-theme/',
'package' => 'https://downloads.wordpress.org/theme/a-fake-theme.9.9.zip',
'requires' => '5.0.0',
'requires_php' => '5.6.20',
);
$test_plugins_enabled =
wp_is_auto_update_forced_for_item( 'plugin', true,
$mock_plugin );
$test_themes_enabled =
wp_is_auto_update_forced_for_item( 'theme', true,
$mock_theme );
$ui_enabled_for_plugins =
wp_is_auto_update_enabled_for_type( 'plugin'
);
$ui_enabled_for_themes =
wp_is_auto_update_enabled_for_type( 'theme'
);
$plugin_filter_present =
has_filter( 'auto_update_plugin'
);
$theme_filter_present =
has_filter( 'auto_update_theme'
);
if ( ( !
$test_plugins_enabled &&
$ui_enabled_for_plugins ) || ( !
$test_themes_enabled &&
$ui_enabled_for_themes ) ) { return (object) array
(