Skip to content

Commit f1c8b1d

Browse files
committed
Show available update version in backend
1 parent 32537b7 commit f1c8b1d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugin/php/class-admin.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ public function enqueue_assets() {
293293
$plugin_updates = get_site_transient( 'update_plugins' );
294294
$theme_updates = get_site_transient( 'update_themes' );
295295

296+
$plugin_status = isset( $plugin_updates->response[ $plugin_file ] ) ? ( (array) $plugin_updates->response[ $plugin_file ] )['new_version'] : 0;
297+
$theme_status = isset( $theme_updates->response[ Plugin::THEME_SLUG ] ) ? ( (array) $theme_updates->response[ Plugin::THEME_SLUG ] )['new_version'] : 0;
298+
296299
wp_localize_script(
297300
'material-settings',
298301
'materialDesignWizard',
@@ -311,8 +314,8 @@ public function enqueue_assets() {
311314
'iconsUpdateStatus' => esc_html( $this->plugin->assets_rest_controller->get_icons_update_status() ),
312315
'pluginAutoUpdate' => in_array( $plugin_file, get_site_option( 'auto_update_plugins', [] ), true ),
313316
'themeAutoUpdate' => in_array( Plugin::THEME_SLUG, get_site_option( 'auto_update_themes', [] ), true ),
314-
'pluginUpdateStatus' => isset( $plugin_updates->response[ $plugin_file ] ) ? 1 : 0,
315-
'themeUpdateStatus' => isset( $theme_updates->response[ Plugin::THEME_SLUG ] ) ? 1 : 0,
317+
'pluginUpdateStatus' => $plugin_status,
318+
'themeUpdateStatus' => $theme_status,
316319
]
317320
);
318321
}

0 commit comments

Comments
 (0)