Return if no post to avoid warnings
git-svn-id: https://develop.svn.wordpress.org/trunk@12208 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
89a9762c42
commit
97f159fd2d
@ -304,6 +304,9 @@ function get_post_class( $class = '', $post_id = null ) {
|
||||
|
||||
$classes = array();
|
||||
|
||||
if ( empty($post) )
|
||||
return $classes;
|
||||
|
||||
$classes[] = 'post-' . $post->ID;
|
||||
$classes[] = $post->post_type;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user