mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 01:00:04 +00:00
Don't create '0' categories. fixes #4413
git-svn-id: https://develop.svn.wordpress.org/trunk@5739 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -796,6 +796,8 @@ function wp_set_post_categories($post_ID = 0, $post_categories = array()) {
|
||||
// If $post_categories isn't already an array, make it one:
|
||||
if (!is_array($post_categories) || 0 == count($post_categories) || empty($post_categories))
|
||||
$post_categories = array(get_option('default_category'));
|
||||
else if ( 1 == count($post_categories) && '' == $post_categories[0] )
|
||||
return true;
|
||||
|
||||
$post_categories = array_map('intval', $post_categories);
|
||||
$post_categories = array_unique($post_categories);
|
||||
|
||||
Reference in New Issue
Block a user