Filters the list of CSS class names for the current post.
Parameters
$classesstring[]- An array of post class names.
$css_classstring[]- An array of additional class names added to the post.
$post_idint- The post ID.
Source
$classes = apply_filters( 'post_class', $classes, $css_class, $post->ID ); Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
Custom classes for post table rows.
This filter can be used to add additional classes to the rows of post in any
edit.phppost page of the dashboard,The filter is called when ever the function
get_post_class($class, $post_id)is called. It is called at the end of the of function.Internally WordPress will call this function in many places, including the admin dashboard pages. The filter allows you to filter the Array
$classeswhich will be added to the page.Furthermore, the classes passed to the function call by say a plugin or a template will be passed as the 2nd parameter
$class, and finally the third parameter is the ID of the post object being processed by the function.