WP_Site_Health::admin_body_class()publicWP 5.2.0

Adds a class to the body HTML tag.

Filters the body class string for admin pages and adds our own class for easier styling.

Method of the class: WP_Site_Health{}

No Hooks.


String. The modified body class string.


$WP_Site_Health = new WP_Site_Health();
$WP_Site_Health->admin_body_class( $body_class );
$body_class(string) (required)
The body class string.


Since 5.2.0 Introduced.

WP_Site_Health::admin_body_class() code WP 6.1.1

public function admin_body_class( $body_class ) {
	$screen = get_current_screen();
	if ( 'site-health' !== $screen->id ) {
		return $body_class;

	$body_class .= ' site-health';

	return $body_class;