Automattic\WooCommerce\Admin\Features

Features::add_admin_body_classes()public staticWC 1.0

Adds body classes to the main wp-admin wrapper, allowing us to better target elements in specific scenarios.

Метод класса: Features{}

No Hooks.

Return

null. Nothing.

Usage

$result = Features::add_admin_body_classes( $admin_body_class );
$admin_body_class(string)
Body class to add.
Default: ''

Code of Features::add_admin_body_classes() WC 7.1.0

public static function add_admin_body_classes( $admin_body_class = '' ) {
	if ( ! PageController::is_admin_or_embed_page() ) {
		return $admin_body_class;
	}

	$classes = explode( ' ', trim( $admin_body_class ) );

	$features = self::get_features();
	foreach ( $features as $feature_key ) {
		$classes[] = sanitize_html_class( 'woocommerce-feature-enabled-' . $feature_key );
	}

	$admin_body_class = implode( ' ', array_unique( $classes ) );
	return " $admin_body_class ";
}