WP_Site_Health::admin_body_class() WordPress Method

The WP_Site_Health::admin_body_class() method is used to add CSS classes to the body element on the site health page in the WordPress admin.

WP_Site_Health::admin_body_class( string $body_class ) #

Add a class to the body HTML tag.


Description

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


Top ↑

Parameters

$body_class

(string)(Required)The body class string.


Top ↑

Return

(string) The modified body class string.


Top ↑

Source

File: wp-admin/includes/class-wp-site-health.php

	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;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.