Ticket #35209: 35209.2.patch
File 35209.2.patch, 1.3 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/post.js
766 766 767 767 buttons.html(buttonsOrig); 768 768 permalink.html(permalinkOrig); 769 real_slug.val( new_slug);769 real_slug.val($('#editable-post-name-full').text()); 770 770 $( '.edit-slug' ).focus(); 771 771 wp.a11y.speak( postL10n.permalinkSaved ); 772 772 }); -
src/wp-includes/post.php
3146 3146 */ 3147 3147 $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, compact( array_keys( $postarr ) ), $postarr ); 3148 3148 3149 $post_name = wp_unique_post_slug( $post_name, $post_ID, $post_status, $post_type, $post_parent ); 3149 // Hack: wp_unique_post_slug() doesn't work for drafts, so we will fake that our post is published. 3150 $post_status_draftsafe = ( ! empty( $post_name ) && in_array( $post_status, array( 'draft', 'pending' ) ) ) ? 'publish' : $post_status; 3151 $post_name = wp_unique_post_slug( $post_name, $post_ID, $post_status_draftsafe, $post_type, $post_parent ); 3150 3152 3151 3153 // Don't unslash. 3152 3154 $post_mime_type = isset( $postarr['post_mime_type'] ) ? $postarr['post_mime_type'] : '';