From 3dea05d10c70e6e6db96df93667cde357139315a Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Tue, 4 May 2010 18:41:38 +0000 Subject: [PATCH] use reset vs offset 0, props scribu, see #13246 git-svn-id: https://develop.svn.wordpress.org/trunk@14447 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 18f5403155..8c54b01db4 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2567,12 +2567,12 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) { $post_ID = (int) $post_ID; $post_type = get_post_type( $post_ID ); // If $post_categories isn't already an array, make it one: - if ( !is_array($post_categories) || 0 == count($post_categories) || empty($post_categories) ) { + if ( !is_array($post_categories) || empty($post_categories) ) { if ( 'post' == $post_type ) $post_categories = array( get_option('default_category') ); else $post_categories = array(); - } else if ( 1 == count($post_categories) && '' == $post_categories[0] ) { + } else if ( 1 == count($post_categories) && '' == reset($post_categories) ) { return true; }