WordPress.org

Make WordPress Core

Ticket #16550: 16550.diff

File 16550.diff, 675 bytes (added by wonderboymusic, 19 months ago)
  • wp-includes/post.php

    diff --git a/wp-includes/post.php b/wp-includes/post.php
    index 03f31ef..2f92af0 100644
    a b function wp_set_post_categories($post_ID = 0, $post_categories = array()) { 
    31923192        $post_type = get_post_type( $post_ID ); 
    31933193        $post_status = get_post_status( $post_ID ); 
    31943194        // If $post_categories isn't already an array, make it one: 
    3195         if ( !is_array($post_categories) || empty($post_categories) ) { 
     3195        $post_categories = (array) $post_categories;  
     3196        if ( empty( $post_categories ) ) { 
    31963197                if ( 'post' == $post_type && 'auto-draft' != $post_status ) 
    31973198                        $post_categories = array( get_option('default_category') ); 
    31983199                else