Ticket #9674: post.php.diff
File post.php.diff, 923 bytes (added by , 15 years ago) |
---|
-
post.php
3144 3144 // export array as variables 3145 3145 extract($object, EXTR_SKIP); 3146 3146 3147 // Make sure we set a valid category3148 if ( !isset($post_category) || 0 == count($post_category) || !is_array($post_category)) {3149 $post_category = array(get_option('default_category'));3150 }3151 3152 3147 if ( empty($post_author) ) 3153 3148 $post_author = $user_ID; 3154 3149 3155 3150 $post_type = 'attachment'; 3156 3151 $post_status = 'inherit'; 3152 3153 // Make sure we set a valid category. 3154 if ( !isset($post_category) || 0 == count($post_category) || !is_array($post_category) ) { 3155 // 'post' requires at least one category. 3156 if ( 'post' == $post_type ) 3157 $post_category = array( get_option('default_category') ); 3158 else 3159 $post_category = array(); 3160 } 3157 3161 3158 3162 // Are we updating or creating? 3159 3163 if ( !empty($ID) ) {