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:
Ryan Boren 2009-11-18 21:04:09 +00:00
parent 89a9762c42
commit 97f159fd2d
1 changed files with 3 additions and 0 deletions

View File

@ -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;