Core Function
View Source on Trac ↗ get_post_class()
get_post_class( mixed $css_class = '', mixed $post = null ) Retrieves an array of the class names for the post container element.
Parameters 2 required
| Name / Type | Description |
|---|---|
| mixed | (string | string[]) $css_class Optional. Space-separated string or array of class names to add to the class list. Default empty. Required |
| (int | | WP_Post) $post Optional. Post ID or post object. Required |
Return Value
(string[])
Array of class names.
Function Information
Since Version
2.7.0
Source File
wp-includes/post-template.php
Advertisement