admin_body_class WordPress Filter Hook

The admin_body_class hook is used to add extra classes to the body tag on the admin pages. This can be useful for targeting specific admin pages with CSS or JavaScript.

apply_filters( 'admin_body_class', string $classes ) #

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:

  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.

Top ↑

Parameters

$classes

(string)Space-separated list of CSS classes.


Top ↑

Source

File: wp-admin/admin-header.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.3.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.