Changeset 13291 for trunk/wp-includes/post.php
- Timestamp:
- 02/22/2010 05:19:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r13289 r13291 3134 3134 extract($object, EXTR_SKIP); 3135 3135 3136 // Make sure we set a valid category3137 if ( !isset($post_category) || 0 == count($post_category) || !is_array($post_category)) {3138 $post_category = array(get_option('default_category'));3139 }3140 3141 3136 if ( empty($post_author) ) 3142 3137 $post_author = $user_ID; … … 3144 3139 $post_type = 'attachment'; 3145 3140 $post_status = 'inherit'; 3141 3142 // Make sure we set a valid category. 3143 if ( !isset($post_category) || 0 == count($post_category) || !is_array($post_category) ) { 3144 // 'post' requires at least one category. 3145 if ( 'post' == $post_type ) 3146 $post_category = array( get_option('default_category') ); 3147 else 3148 $post_category = array(); 3149 } 3146 3150 3147 3151 // Are we updating or creating?
Note: See TracChangeset
for help on using the changeset viewer.