diff --git a/src/Admin/SiteHealth.php b/src/Admin/SiteHealth.php index 987ec3076d6..105ace0cf99 100644 --- a/src/Admin/SiteHealth.php +++ b/src/Admin/SiteHealth.php @@ -29,7 +29,7 @@ public function init() { add_filter( 'site_status_tests', [ $this, 'add_tests' ] ); add_filter( 'debug_information', [ $this, 'add_debug_information' ] ); add_filter( 'site_status_test_php_modules', [ $this, 'add_extensions' ] ); - add_action( 'admin_print_styles', [ $this, 'add_styles' ] ); + add_action( 'admin_print_styles-site-health.php', [ $this, 'add_styles' ] ); ( new ReenableCssTransientCachingAjaxAction() )->register(); } diff --git a/tests/php/test-class-site-health.php b/tests/php/test-class-site-health.php index 4e79b234ed0..439f5264abd 100644 --- a/tests/php/test-class-site-health.php +++ b/tests/php/test-class-site-health.php @@ -55,6 +55,7 @@ public function test_init() { $this->assertEquals( 10, has_action( 'site_status_tests', [ $this->instance, 'add_tests' ] ) ); $this->assertEquals( 10, has_action( 'debug_information', [ $this->instance, 'add_debug_information' ] ) ); $this->assertEquals( 10, has_action( 'site_status_test_php_modules', [ $this->instance, 'add_extensions' ] ) ); + $this->assertEquals( 10, has_action( 'admin_print_styles-site-health.php', [ $this->instance, 'add_styles' ] ) ); } /**