Check if post is array before checking if key exists in preset

This commit is contained in:
Brian Miyaji
2015-02-02 23:45:37 +11:00
parent a3bec0c340
commit d39a2f4b7f

View File

@@ -228,7 +228,7 @@ class SP_Admin_Sports {
$post_array['post_type'] = $post_type; $post_array['post_type'] = $post_type;
// Add post excerpt // Add post excerpt
if ( array_key_exists( 'description', $post ) ) { if ( is_array( $post ) && array_key_exists( 'description', $post ) ) {
$post_array['post_excerpt'] = $post['description']; $post_array['post_excerpt'] = $post['description'];
} }