Skip to content

Commit 151a243

Browse files
committed
Enable theme and plugin auto update options for WP 5.5 and above
1 parent 5ca5c39 commit 151a243

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

plugin/assets/src/settings/constants.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const ACTIONS = {
3434
SET_UPDATED: 'SET_UPDATED',
3535
};
3636

37-
export const UPDATERS = {
37+
const ASSET_UPDATES = {
3838
FONTS: {
3939
title: __( 'Google Fonts', 'material-design' ),
4040
type: 'FONTS',
@@ -51,6 +51,9 @@ export const UPDATERS = {
5151
updateAvailable: 'update' === getConfig( 'iconsUpdateStatus' ),
5252
autoUpdates: parseInt( getConfig( 'iconsAutoUpdate' ), 10 ),
5353
},
54+
};
55+
56+
const CORE_UPDATES = {
5457
PLUGIN: {
5558
title: __( 'Material Design Plugin', 'material-design' ),
5659
type: 'PLUGIN',
@@ -73,4 +76,9 @@ export const UPDATERS = {
7376
},
7477
};
7578

79+
export const UPDATERS = {
80+
...ASSET_UPDATES,
81+
...( getConfig( 'coreUpdatesEnabled' ) ? CORE_UPDATES : {} ),
82+
};
83+
7684
export const KEY_PLACEHOLDER = '•••••••••••••••••••••••••••••';

plugin/php/class-admin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ public function enqueue_assets() {
319319
'themeAutoUpdate' => in_array( Plugin::THEME_SLUG, get_site_option( 'auto_update_themes', [] ), true ),
320320
'pluginUpdateStatus' => $plugin_status,
321321
'themeUpdateStatus' => $theme_status,
322+
'coreUpdatesEnabled' => version_compare( get_bloginfo( 'version' ), '5.5', '>=' ),
322323
'coreUpdateUrl' => admin_url( 'update-core.php' ),
323324
'autoUpdateNonce' => wp_create_nonce( 'updates' ),
324325
'autoUpdateUrl' => admin_url( 'admin-ajax.php' ),

0 commit comments

Comments
 (0)