WordPress.org

Make WordPress Core

Changeset 18082


Ignore:
Timestamp:
05/31/11 16:08:46 (4 years ago)
Author:
ryan
Message:

Don't set fields to empty values in _wp_translate_data(). Props scribu, johnjamesjacoby. fixes #16673

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r18074 r18082  
    2626    if ( $update ) 
    2727        $post_data['ID'] = (int) $post_data['post_ID']; 
    28     $post_data['post_content'] = isset($post_data['content']) ? $post_data['content'] : ''; 
    29     $post_data['post_excerpt'] = isset($post_data['excerpt']) ? $post_data['excerpt'] : ''; 
    30     $post_data['post_parent'] = isset($post_data['parent_id'])? $post_data['parent_id'] : ''; 
     28 
     29    if ( isset( $post_data['content'] ) ) 
     30        $post_data['post_content'] = $post_data['content']; 
     31 
     32    if ( isset( $post_data['excerpt'] ) ) 
     33        $post_data['post_excerpt'] = $post_data['excerpt']; 
     34 
     35    if ( isset( $post_data['parent_id'] ) ) 
     36        $post_data['post_parent'] = (int) $post_data['parent_id']; 
     37 
    3138    if ( isset($post_data['trackback_url']) ) 
    3239        $post_data['to_ping'] = $post_data['trackback_url']; 
Note: See TracChangeset for help on using the changeset viewer.