Skip to content

Commit fe696ce

Browse files
committed
add min file for login.css hook
1 parent 2d2ffc8 commit fe696ce

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

inc/Services/Assets.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function boot( Service_Container $container ): void {
3838
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
3939
add_action( 'wp_print_styles', [ $this, 'enqueue_styles' ] );
4040
add_filter( 'stylesheet_uri', [ $this, 'stylesheet_uri' ] );
41+
add_filter( 'wp_login_page_theme_css', [ $this, 'login_stylesheet_uri' ] );
4142
}
4243

4344
/**
@@ -162,4 +163,12 @@ public function get_min_file( string $type ): string {
162163

163164
return $file;
164165
}
166+
167+
/**
168+
* Change login CSS URL
169+
* @return string
170+
*/
171+
public function login_stylesheet_uri(): string {
172+
return ( ! defined( 'SCRIPT_DEBUG' ) || SCRIPT_DEBUG === false ) ? 'dist/' . $this->get_min_file( 'login' ) : 'dist/login.css';
173+
}
165174
}

0 commit comments

Comments
 (0)