Skip to content

Commit f4611f9

Browse files
committed
Load css script in admin
1 parent 99557c6 commit f4611f9

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

assets/css/monei-admin.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
.monei-settings-header-welcome p {
1616
font-size: 16px;
1717
}
18-
/* Hide the Monei tab in the main row of WooCommerce settings */
1918
.wc-settings-sub-nav a[href*="tab=monei_settings"] {
2019
display: none !important;
2120
}
22-
/* Also hide it in the "horizontal" tabs if WooCommerce uses them */
2321
.nav-tab-wrapper a.nav-tab[href*="tab=monei_settings"] {
2422
display: none !important;
2523
}

src/Settings/MoneiSettings.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,17 @@ public function enqueue_admin_scripts( $hook ) {
102102

103103
$screen = get_current_screen();
104104

105-
// Ensure we're on the WooCommerce settings page
106-
if ( $screen->id !== 'woocommerce_page_wc-settings' ) {
107-
return;
108-
}
105+
// Ensure we're on the WooCommerce settings page
106+
if ($screen->id !== 'woocommerce_page_wc-settings') {
107+
return;
108+
}
109109

110-
// Check if our settings tab is active
111-
//phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
112-
if ( isset( $_GET['tab'] ) && $_GET['tab'] === $this->id ) {
113-
$plugin_url = plugin_dir_url( dirname( __DIR__ ) );
114-
wp_enqueue_style(
115-
'monei-admin-css',
116-
$plugin_url . 'public/css/monei-admin.css',
117-
array(),
118-
'1.0.0'
119-
);
120-
}
110+
$plugin_url = plugin_dir_url(dirname(__DIR__));
111+
wp_enqueue_style(
112+
'monei-admin-css',
113+
$plugin_url . 'public/css/monei-admin.css',
114+
array(),
115+
'1.0.0'
116+
);
121117
}
122118
}

0 commit comments

Comments
 (0)