From 1e5889b9fa95a2449f010d059a1e0f8a16836479 Mon Sep 17 00:00:00 2001 From: Tom McCaffery Date: Sun, 24 Oct 2021 22:45:18 -0400 Subject: [PATCH] Only load admin CSS when showing settings page --- includes/openid-connect-generic-settings-page.php | 2 ++ openid-connect-generic.php | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/openid-connect-generic-settings-page.php b/includes/openid-connect-generic-settings-page.php index 070eb693..39ed3703 100644 --- a/includes/openid-connect-generic-settings-page.php +++ b/includes/openid-connect-generic-settings-page.php @@ -414,6 +414,8 @@ public function sanitize_settings( $input ) { * @return void */ public function settings_page() { + wp_enqueue_style( 'daggerhart-openid-connect-generic-admin', plugin_dir_url( __DIR__ ) . 'css/styles-admin.css', array(), OpenID_Connect_Generic::VERSION, 'all' ); + $redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); if ( $this->settings->alternate_redirect_uri ) { diff --git a/openid-connect-generic.php b/openid-connect-generic.php index fcb94ddf..731d4897 100644 --- a/openid-connect-generic.php +++ b/openid-connect-generic.php @@ -130,8 +130,6 @@ public function __construct( OpenID_Connect_Generic_Option_Settings $settings, O */ public function init() { - wp_enqueue_style( 'daggerhart-openid-connect-generic-admin', plugin_dir_url( __FILE__ ) . 'css/styles-admin.css', array(), self::VERSION, 'all' ); - $redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); if ( $this->settings->alternate_redirect_uri ) {