@@ -47,14 +47,17 @@ public function actionsAndFilters() {
47
47
//Then we can hide the core and make it update with the latest version when this other plugin is updating/
48
48
add_action ( 'upgrader_process_complete ' , [ $ this , 'WPPBundledUpgrade ' ], 10 , 2 );
49
49
//add_action( 'site_transient_update_plugins', [ $this, 'WPPBundledUpdate' ] );
50
- // add_action( 'pre_current_active_plugins', [ $this, 'maybe_hide_plugin' ] );
51
- // add_filter( 'all_plugins', [ $this, 'multisite_maybe_hide_plugin' ] );
50
+ add_action ( 'pre_current_active_plugins ' , [ $ this , 'maybe_hide_plugin ' ] );
51
+ add_filter ( 'all_plugins ' , [ $ this , 'multisite_maybe_hide_plugin ' ] );
52
52
}
53
53
54
54
55
55
public function multisite_maybe_hide_plugin ( $ plugins ) {
56
56
if ( count ( self ::getSingletons () ) > 1 ) {
57
- unset( $ plugins [ $ this ->getPluginFile () ] );
57
+ $ updates = get_transient ( 'update_plugins ' );
58
+ if ( ! isset ( $ updates ->response [ $ this ->getPluginFile () ] ) ) {
59
+ unset( $ plugins [ $ this ->getPluginFile () ] );
60
+ }
58
61
}
59
62
60
63
return $ plugins ;
@@ -63,7 +66,10 @@ public function multisite_maybe_hide_plugin( $plugins ) {
63
66
public function maybe_hide_plugin () {
64
67
global $ wp_list_table ;
65
68
if ( count ( self ::getSingletons () ) > 1 && isset ( $ wp_list_table ->items [ $ this ->getPluginFile () ] ) ) {
66
- unset( $ wp_list_table ->items [ $ this ->getPluginFile () ] );
69
+ $ updates = get_transient ( 'update_plugins ' );
70
+ if ( ! isset ( $ updates ->response [ $ this ->getPluginFile () ] ) ) {
71
+ unset( $ wp_list_table ->items [ $ this ->getPluginFile () ] );
72
+ }
67
73
}
68
74
}
69
75
0 commit comments