@@ -188,13 +188,7 @@ private function setup_constants(): void {
188
188
private function hooks (): void {
189
189
190
190
// Multisite compatibility: only loads on main site.
191
- if ( is_network_admin () ) {
192
- $ this ->multisite_compatibility = new WP_Rollback_Multisite_Compatibility ( $ this );
193
- }
194
-
195
- if ( is_multisite () && ! is_network_admin () ) {
196
- return ;
197
- }
191
+ $ this ->multisite_compatibility = new WP_Rollback_Multisite_Compatibility ( $ this );
198
192
199
193
// i18n
200
194
add_action ( 'plugins_loaded ' , [ self ::$ instance , 'load_textdomain ' ] );
@@ -228,7 +222,7 @@ private function hooks(): void {
228
222
public function scripts ( $ hook ): void {
229
223
230
224
// Theme's listing page JS
231
- if ( 'themes.php ' === $ hook ) {
225
+ if ( 'themes.php ' === $ hook && ! is_multisite () ) {
232
226
$ theme_script_asset = require WP_ROLLBACK_PLUGIN_DIR . '/build/themes.asset.php ' ;
233
227
234
228
wp_enqueue_script (
@@ -477,6 +471,11 @@ private function setup_plugin_vars() {
477
471
* @return array $actions
478
472
*/
479
473
public function plugin_action_links ( $ actions , $ plugin_file , $ plugin_data , $ context ): array {
474
+
475
+ if ( !is_network_admin ()) {
476
+ return $ actions ;
477
+ }
478
+
480
479
// Filter for other devs.
481
480
$ plugin_data = apply_filters ( 'wpr_plugin_data ' , $ plugin_data );
482
481
@@ -492,7 +491,7 @@ public function plugin_action_links( $actions, $plugin_file, $plugin_data, $cont
492
491
}
493
492
494
493
// Base rollback URL
495
- $ rollback_url = admin_url ( 'index.php ' );
494
+ $ rollback_url = is_network_admin () ? network_admin_url ( ' index.php ' ) : admin_url ( 'index.php ' );
496
495
497
496
$ rollback_url = add_query_arg (
498
497
apply_filters (
@@ -688,7 +687,7 @@ public function wpr_prepare_themes_js( $prepared_themes ): array {
688
687
689
688
// Loop through themes and provide a 'hasRollback' boolean key for JS.
690
689
foreach ( $ prepared_themes as $ key => $ value ) {
691
- $ themes [ $ key ] = $ prepared_themes [ $ key ] ;
690
+ $ themes [ $ key ] = $ value ;
692
691
$ themes [ $ key ]['hasRollback ' ] = isset ( $ rollbacks [ $ key ] );
693
692
}
694
693
0 commit comments