From fe696cee7292c37d5972d3f5e4cb50ceba596378 Mon Sep 17 00:00:00 2001 From: Alexandre Sadowski Date: Mon, 22 Nov 2021 16:28:56 +0100 Subject: [PATCH] add min file for login.css hook --- inc/Services/Assets.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inc/Services/Assets.php b/inc/Services/Assets.php index a6fabfed..d8f43c34 100644 --- a/inc/Services/Assets.php +++ b/inc/Services/Assets.php @@ -38,6 +38,7 @@ public function boot( Service_Container $container ): void { add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); add_action( 'wp_print_styles', [ $this, 'enqueue_styles' ] ); add_filter( 'stylesheet_uri', [ $this, 'stylesheet_uri' ] ); + add_filter( 'wp_login_page_theme_css', [ $this, 'login_stylesheet_uri' ] ); } /** @@ -162,4 +163,12 @@ public function get_min_file( string $type ): string { return $file; } + + /** + * Change login CSS URL + * @return string + */ + public function login_stylesheet_uri(): string { + return ( ! defined( 'SCRIPT_DEBUG' ) || SCRIPT_DEBUG === false ) ? 'dist/' . $this->get_min_file( 'login' ) : 'dist/login.css'; + } }