apply_filters( 'body_class', string[] $classes, string[] $class )

Filters the list of CSS body class names for the current post or page.

Parameters

$classes

(string[]) An array of body class names.

$class

(string[]) 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 on Trac

Changelog

Version Description
2.8.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/body_class