mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
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:
parent
e7941d795e
commit
039a004122
@ -304,6 +304,9 @@ function get_post_class( $class = '', $post_id = null ) {
|
|||||||
|
|
||||||
$classes = array();
|
$classes = array();
|
||||||
|
|
||||||
|
if ( empty($post) )
|
||||||
|
return $classes;
|
||||||
|
|
||||||
$classes[] = 'post-' . $post->ID;
|
$classes[] = 'post-' . $post->ID;
|
||||||
$classes[] = $post->post_type;
|
$classes[] = $post->post_type;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user