-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshow-ghost-updates.php
26 lines (21 loc) · 1011 Bytes
/
show-ghost-updates.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// This snippet is based on the code from https://stackoverflow.com/questions/22137814/wordpress-shows-i-have-1-plugin-update-when-all-plugins-are-already-updated
$output = "";
// Check plugins
$plugin_updates = get_site_transient( 'update_plugins' );
if ( $plugin_updates && ! empty( $plugin_updates->response ) ) {
foreach ( $plugin_updates->response as $plugin => $details ) {
$title = $details->title;
$output .= "<p><strong>Plugin</strong> <u>$title</u> ($plugin) is reporting an available update.</p>";
}
}
// Check themes
wp_update_themes();
$theme_updates = get_site_transient( 'update_themes' );
if ( $theme_updates && ! empty( $theme_updates->response ) ) {
foreach ( $theme_updates->response as $theme => $details ) {
$title = $details->title;
$output .= "<p><strong>Theme</strong> <u>$title</u> ($theme) is reporting an available update.</p>";
}
}
if ( empty( $output ) ) $output = "No pending updates found in the database.";
echo "<h2>Pending updates</h2>" . $output;