On this page
apply_filters( 'body_class', string[] $classes, string[] $class )
Filters the list of CSS body class names for the current post or page.
Parameters
$classesstring[]-
An array of body class names.
$classstring[]-
An array of additional class names added to the body.
More Information
Note that the filter function must return the array of classes after it is finished processing, or all of the classes will be cleared and could seriously impact the visual state of a user’s site.
Source
File: wp-includes/post-template.php. View all references
$classes = apply_filters( 'body_class', $classes, $class );
Related
Used By
| Used By | Description |
|---|---|
| get_body_class() wp-includes/post-template.php | Retrieves an array of the class names for the body element. |
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/body_class