Changeset 14883
- Timestamp:
- 05/25/2010 02:43:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r14857 r14883 2175 2175 $post_type = 'post'; 2176 2176 2177 if ( empty($post_status) ) 2178 $post_status = 'draft'; 2179 2177 2180 if ( !empty($post_category) ) 2178 2181 $post_category = array_filter($post_category); // Filter out empty terms … … 2181 2184 if ( empty($post_category) || 0 == count($post_category) || !is_array($post_category) ) { 2182 2185 // 'post' requires at least one category. 2183 if ( 'post' == $post_type )2186 if ( 'post' == $post_type && 'auto-draft' != $post_status ) 2184 2187 $post_category = array( get_option('default_category') ); 2185 2188 else … … 2189 2192 if ( empty($post_author) ) 2190 2193 $post_author = $user_ID; 2191 2192 if ( empty($post_status) )2193 $post_status = 'draft';2194 2194 2195 2195 $post_ID = 0; … … 2661 2661 $post_ID = (int) $post_ID; 2662 2662 $post_type = get_post_type( $post_ID ); 2663 $post_status = get_post_status( $post_ID ); 2663 2664 // If $post_categories isn't already an array, make it one: 2664 2665 if ( !is_array($post_categories) || empty($post_categories) ) { 2665 if ( 'post' == $post_type )2666 if ( 'post' == $post_type && 'auto-draft' != $post_status ) 2666 2667 $post_categories = array( get_option('default_category') ); 2667 2668 else
Note: See TracChangeset
for help on using the changeset viewer.