Ticket #20462: 20462.2.diff
| File 20462.2.diff, 1.2 KB (added by wonderboymusic, 5 months ago) |
|---|
-
wp-includes/post.php
2972 2972 $postarr = add_magic_quotes($postarr); 2973 2973 } 2974 2974 2975 // First, get all of the original fields 2976 $post = get_post($postarr['ID'], ARRAY_A); 2975 $post = array(); 2977 2976 2978 // Escape data pulled from DB. 2979 $post = add_magic_quotes($post); 2977 if ( ! empty( $postarr['ID'] ) ) { 2978 // First, get all of the original fields 2979 $post = get_post( $postarr['ID'], ARRAY_A ); 2980 2980 2981 // Escape data pulled from DB. 2982 $post = add_magic_quotes( $post ); 2983 } 2984 2981 2985 // Passed post category list overwrites existing category list if not empty. 2982 if ( isset($postarr['post_category']) && is_array($postarr['post_category']) 2983 && 0 != count($postarr['post_category']) ) 2984 $post_cats = $postarr['post_category']; 2985 else 2986 $post_cats = $post['post_category']; 2986 $post_cats = empty( $post['post_category'] ) ? array() : (array) $post['post_category']; 2987 2987 2988 2988 // Drafts shouldn't be assigned a date unless explicitly done so by the user 2989 2989 if ( isset( $post['post_status'] ) && in_array($post['post_status'], array('draft', 'pending', 'auto-draft')) && empty($postarr['edit_date']) &&