Ticket #22902: 22902.2.patch
| File 22902.2.patch, 1.5 KB (added by SergeyBiryukov, 3 months ago) |
|---|
-
wp-admin/includes/ajax-actions.php
1350 1350 if ( empty($data['ping_status']) ) 1351 1351 $data['ping_status'] = 'closed'; 1352 1352 1353 // Hack: wp_unique_post_slug() doesn't work for drafts, so we will fake that our post is published. 1354 if ( ! empty( $data['post_name'] ) && in_array( $post['post_status'], array( 'draft', 'pending' ) ) ) { 1355 $post['post_status'] = 'publish'; 1356 $data['post_name'] = wp_unique_post_slug( $data['post_name'], $post['ID'], $post['post_status'], $post['post_type'], $post['post_parent'] ); 1357 } 1358 1353 1359 // update the post 1354 1360 edit_post(); 1355 1361 -
wp-admin/includes/post.php
999 999 $original_date = $post->post_date; 1000 1000 $original_name = $post->post_name; 1001 1001 1002 // Hack: get_permalink would return ugly permalink for 1003 // drafts, so we will fake, that our post is published 1004 if ( in_array($post->post_status, array('draft', 'pending')) ) { 1002 // Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published. 1003 if ( in_array( $post->post_status, array( 'draft', 'pending' ) ) ) { 1005 1004 $post->post_status = 'publish'; 1006 1005 $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID); 1007 1006 }
