Filters the CSS classes for the body tag in the admin.
Description
This filter differs from the ‘post_class’ and ‘body_class’ filters in two important ways:
$classes
is a space-separated string of class names instead of an array.- Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, and no-js cannot be removed.
Parameters
$classes
string- Space-separated list of CSS classes.
Source
$admin_body_classes = apply_filters( 'admin_body_class', '' );
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |
When adding new classes to the body, you should make sure to add spaces before and after your class name. This prevents accidental concatenation of two plugins class-names.
Example:
If the current page is a post/page in edit mode