WordPress at a glance
filter is not described

admin_body_class filter-hook . WP 2.3.0

Filters the CSS classes for the body tag in the admin.

This filter differs from the 'post_class' and 'body_class' filters in two important ways:

  1. $classes is a space-separated string of class names instead of an array.
  2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui,
    and no-js cannot be removed.


add_filter( 'admin_body_class', 'filter_function_name_9070' );
function filter_function_name_9070( $classes ){
	// filter...

	return $classes;
Space-separated list of CSS classes.

Список изменений

С версии 2.3.0 Введена.

Где вызывается хук

В файле: /wp-admin/admin-header.php
wp-admin/admin-header.php 231
$admin_body_classes = apply_filters( 'admin_body_class', '' );
wp-admin/includes/template.php 2066
$admin_body_classes = apply_filters( 'admin_body_class', '' );

Где используется хук в ядре WP

wp-admin/includes/class-wp-site-health.php 49
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
wp-admin/nav-menus.php 580
add_filter( 'admin_body_class', 'wp_nav_menu_max_depth' );
wp-admin/widgets.php 32
add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );