On this page
apply_filters( 'post_class', string[] $classes, string[] $class, int $post_id )
Filters the list of CSS class names for the current post.
Parameters
$classesstring[]-
An array of post class names.
$classstring[]-
An array of additional class names added to the post.
$post_idint-
The post ID.
Source
File: wp-includes/post-template.php. View all references
$classes = apply_filters( 'post_class', $classes, $class, $post->ID );
Related
Used By
| Used By | Description |
|---|---|
| get_post_class() wp-includes/post-template.php | Retrieves an array of the class names for the post container element. |
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/post_class