Return if no post to avoid warnings

git-svn-id: http://svn.automattic.com/wordpress/trunk@12208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-11-18 21:04:09 +00:00
parent e7941d795e
commit 039a004122
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;