From 1beb7406da1bf231e62400c3887d3377e78edaac Mon Sep 17 00:00:00 2001 From: wpmuguru Date: Tue, 4 May 2010 18:41:38 +0000 Subject: [PATCH] use reset vs offset 0, props scribu, see #13246 git-svn-id: http://svn.automattic.com/wordpress/trunk@14447 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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; }