Skip to content

Commit

Permalink
Prevent printing styles for Site Health on every admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
pierlon committed Jun 16, 2020
1 parent 4b4791e commit 51124ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Admin/SiteHealth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions tests/php/test-class-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] ) );
}

/**
Expand Down

0 comments on commit 51124ee

Please sign in to comment.