Skip to content
This repository was archived by the owner on May 29, 2020. It is now read-only.

Commit 4a44ec9

Browse files
authored
Merge pull request #82 from audrasjb/add/themes-update-core-scren
Add Themes auto-updates to update-core.php screen
2 parents 8ae7727 + 3452fb3 commit 4a44ec9

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

css/wp-autoupdates.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
color: #006505;
1818
}
1919

20-
.plugins .plugin-title .plugin-autoupdate-enabled .dashicons {
20+
.plugins .plugin-title .plugin-autoupdate-enabled .dashicons,
21+
#update-themes-table .plugin-title .dashicons {
2122
float: none;
2223
padding: 0;
2324
width: auto;
2425
height: auto;
2526
}
27+
2628
.plugins .plugin-title .plugin-autoupdate-enabled .dashicons:before {
2729
padding: 0;
2830
background: transparent;

wp-autoupdates.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ function wp_autoupdates_enqueues( $hook ) {
3333
// Update core screen JS hack (due to lack of filters)
3434
if ( 'update-core.php' === $hook ) {
3535
$script = 'jQuery( document ).ready(function() {';
36+
37+
if ( wp_autoupdates_is_themes_auto_update_enabled() ) {
38+
$wp_auto_update_themes = get_site_option( 'wp_auto_update_themes', array() );
39+
40+
$update_message = wp_autoupdates_get_update_message();
41+
foreach ( $wp_auto_update_themes as $theme ) {
42+
$autoupdate_text = ' <span class="plugin-autoupdate-enabled"><span class="dashicons dashicons-update" aria-hidden="true"></span> ';
43+
$autoupdate_text .= $update_message;
44+
$autoupdate_text .= '</span> ';
45+
$script .= 'jQuery(".check-column input[value=\'' . $theme . '\']").closest("tr").find(".plugin-title > p").append(\'' . $autoupdate_text . '\');';
46+
}
47+
}
48+
3649
if ( wp_autoupdates_is_plugins_auto_update_enabled() ) {
3750
$wp_auto_update_plugins = get_site_option( 'wp_auto_update_plugins', array() );
3851

0 commit comments

Comments
 (0)