Skip to content

Commit

Permalink
Enable theme and plugin auto update options for WP 5.5 and above
Browse files Browse the repository at this point in the history
  • Loading branch information
ravichdev committed Apr 8, 2021
1 parent d78daa3 commit d371453
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugin/assets/src/settings/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const ACTIONS = {
SET_UPDATED: 'SET_UPDATED',
};

export const UPDATERS = {
const ASSET_UPDATES = {
FONTS: {
title: __( 'Google Fonts', 'material-design' ),
type: 'FONTS',
Expand All @@ -51,6 +51,9 @@ export const UPDATERS = {
updateAvailable: 'update' === getConfig( 'iconsUpdateStatus' ),
autoUpdates: parseInt( getConfig( 'iconsAutoUpdate' ), 10 ),
},
};

const CORE_UPDATES = {
PLUGIN: {
title: __( 'Material Design Plugin', 'material-design' ),
type: 'PLUGIN',
Expand All @@ -73,4 +76,9 @@ export const UPDATERS = {
},
};

export const UPDATERS = {
...ASSET_UPDATES,
...( getConfig( 'coreUpdatesEnabled' ) ? CORE_UPDATES : {} ),
};

export const KEY_PLACEHOLDER = '•••••••••••••••••••••••••••••';
1 change: 1 addition & 0 deletions plugin/php/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ public function enqueue_assets() {
'themeAutoUpdate' => in_array( Plugin::THEME_SLUG, get_site_option( 'auto_update_themes', [] ), true ),
'pluginUpdateStatus' => $plugin_status,
'themeUpdateStatus' => $theme_status,
'coreUpdatesEnabled' => version_compare( get_bloginfo( 'version' ), '5.5', '>=' ),
'coreUpdateUrl' => admin_url( 'update-core.php' ),
'autoUpdateNonce' => wp_create_nonce( 'updates' ),
'autoUpdateUrl' => admin_url( 'admin-ajax.php' ),
Expand Down

0 comments on commit d371453

Please sign in to comment.