Filters the list of CSS body class names for the current post or page.
$classesstring[]
$css_classstring[]
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.
$classes = apply_filters( 'body_class', $classes, $css_class );
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/body_class