| 1 | Index: wp-includes/post.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-includes/post.php (revision 1218) |
|---|
| 4 | +++ wp-includes/post.php (working copy) |
|---|
| 5 | @@ -1534,9 +1534,9 @@ |
|---|
| 6 | $where = array( 'ID' => $post_ID ); |
|---|
| 7 | } |
|---|
| 8 | |
|---|
| 9 | - if ( empty($post_name) && !in_array( $post_status, array( 'draft', 'pending' ) ) ) { |
|---|
| 10 | - $post_name = sanitize_title($post_title, $post_ID); |
|---|
| 11 | - $wpdb->update( $wpdb->posts, compact( 'post_name' ), $where ); |
|---|
| 12 | + if ( empty($data['post_name']) && !in_array( $data['post_status'], array( 'draft', 'pending' ) ) ) { |
|---|
| 13 | + $data['post_name'] = sanitize_title($data['post_title'], $post_ID); |
|---|
| 14 | + $wpdb->update( $wpdb->posts, array( 'post_name' => $data['post_name'] ), $where ); |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | wp_set_post_categories( $post_ID, $post_category ); |
|---|
| 18 | @@ -1552,7 +1552,7 @@ |
|---|
| 19 | |
|---|
| 20 | $current_guid = get_post_field( 'guid', $post_ID ); |
|---|
| 21 | |
|---|
| 22 | - if ( 'page' == $post_type ) |
|---|
| 23 | + if ( 'page' == $data['post_type'] ) |
|---|
| 24 | clean_page_cache($post_ID); |
|---|
| 25 | else |
|---|
| 26 | clean_post_cache($post_ID); |
|---|
| 27 | @@ -1563,7 +1563,7 @@ |
|---|
| 28 | |
|---|
| 29 | $post = get_post($post_ID); |
|---|
| 30 | |
|---|
| 31 | - if ( !empty($page_template) && 'page' == $post_type ) { |
|---|
| 32 | + if ( !empty($page_template) && 'page' == $data['post_type'] ) { |
|---|
| 33 | $post->page_template = $page_template; |
|---|
| 34 | $page_templates = get_page_templates(); |
|---|
| 35 | if ( 'default' != $page_template && !in_array($page_template, $page_templates) ) { |
|---|
| 36 | @@ -1575,7 +1575,7 @@ |
|---|
| 37 | update_post_meta($post_ID, '_wp_page_template', $page_template); |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | - wp_transition_post_status($post_status, $previous_status, $post); |
|---|
| 41 | + wp_transition_post_status($data['post_status'], $previous_status, $post); |
|---|
| 42 | |
|---|
| 43 | if ( $update) |
|---|
| 44 | do_action('edit_post', $post_ID, $post); |
|---|