Permalink
Browse files

A little check that $post is an object...

  • Loading branch information...
1 parent 9a086f5 commit 8d2f8c4712571b0b62d23739252aa4d0cdcdd6de @gyrus committed Jun 3, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 slt-cf-init.php
View
2 slt-cf-init.php
@@ -452,7 +452,7 @@ function slt_cf_init_fields( $request_type, $scope, $object_id ) {
$field['options_query']['orderby'] = 'category';
// Exclude current post?
if ( $field[ 'exclude_current' ] ) {
- if ( property_exists( $post, 'ID' ) )
+ if ( is_object( $post ) && property_exists( $post, 'ID' ) )
$field['options_query']['post__not_in'][] = $post->ID;
}
$posts_query = new WP_Query( $field['options_query'] );

0 comments on commit 8d2f8c4

Please sign in to comment.