Skip to content

Commit 0d873ae

Browse files
committed
Autoupdates: adding functionality to autoupdate core installation
1 parent 956b913 commit 0d873ae

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

class.jetpack-autoupdate.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static function init() {
1717
private function __construct() {
1818
$this->updates_allowed = Jetpack_Options::get_option( 'json_api_full_management', false );
1919

20-
if( $this->updates_allowed ) {
20+
if ( $this->updates_allowed ) {
2121
add_filter( 'auto_update_plugin', array( $this, 'autoupdate_plugin' ), 10, 2 );
2222
add_filter( 'auto_update_theme', array( $this, 'autoupdate_theme' ), 10, 2 );
2323
add_filter( 'auto_update_core', array( $this, 'autoupdate_core' ), 10, 2 );
@@ -26,7 +26,7 @@ private function __construct() {
2626

2727
function autoupdate_plugin( $update, $item ) {
2828
$autoupdate_plugin_list = Jetpack_Options::get_option( 'autoupdate_plugins', array() );
29-
if( in_array( $item->plugin, $autoupdate_plugin_list ) ) {
29+
if ( in_array( $item->plugin, $autoupdate_plugin_list ) ) {
3030
return true;
3131
}
3232

@@ -35,13 +35,17 @@ function autoupdate_plugin( $update, $item ) {
3535

3636
function autoupdate_theme( $update, $item ) {
3737
$autoupdate_theme_list = Jetpack_Options::get_option( 'autoupdate_themes', array() );
38-
if( in_array( $item->theme , $autoupdate_theme_list) ) {
38+
if ( in_array( $item->theme , $autoupdate_theme_list) ) {
3939
return true;
4040
}
4141
return $update;
4242
}
4343

4444
function autoupdate_core( $update, $item ) {
45+
$autoupdate_core = Jetpack_Options::get_option( 'autoupdate_core', false );
46+
if ( $autoupdate_core ) {
47+
return $autoupdate_core;
48+
}
4549
return $update;
4650
}
4751
}

0 commit comments

Comments
 (0)