diff --git wp-admin/edit-form-advanced.php wp-admin/edit-form-advanced.php
index e656dd5..74bb57e 100644
|
|
if ( post_type_supports($post_type, 'comments') ) |
181 | 181 | if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') ) |
182 | 182 | add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core'); |
183 | 183 | |
184 | | if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) |
185 | | add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core'); |
186 | | |
187 | 184 | if ( post_type_supports($post_type, 'author') ) { |
188 | 185 | if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) |
189 | 186 | add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core'); |
… |
… |
if ( !empty($shortlink) ) |
373 | 370 | |
374 | 371 | if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { |
375 | 372 | $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; |
| 373 | |
| 374 | $no_js_permalink = get_sample_permalink($post->ID); |
| 375 | $up_to_permalink = str_replace( '%pagename%/', '', $no_js_permalink[0] ); |
| 376 | $slug = $no_js_permalink[1]; |
376 | 377 | ?> |
| 378 | <div class="hide-if-js"> |
| 379 | <strong><?php _e('Permalink'); ?>: </strong><span><?php echo $up_to_permalink; ?></span><input type="text" name="post_name" id="new_post_name" value="<?php echo $slug; ?>" class="hide-if-js" /> |
| 380 | </div> |
377 | 381 | <div id="edit-slug-box" class="hide-if-no-js"> |
378 | 382 | <?php |
379 | 383 | if ( $has_sample_permalink ) |
diff --git wp-admin/includes/meta-boxes.php wp-admin/includes/meta-boxes.php
index cefa5a9..73fb6d9 100644
|
|
function post_comment_meta_box( $post ) { |
588 | 588 | * @param object $post |
589 | 589 | */ |
590 | 590 | function post_slug_meta_box($post) { |
| 591 | _deprecated_function( __FUNCTION__, '3.7' ); |
591 | 592 | ?> |
592 | 593 | <label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( apply_filters('editable_slug', $post->post_name) ); ?>" /> |
593 | 594 | <?php |
diff --git wp-admin/js/post.js wp-admin/js/post.js
index 7b7d4c3..97f9dd7 100644
|
|
jQuery(document).ready( function($) { |
679 | 679 | }); |
680 | 680 | } // end submitdiv |
681 | 681 | |
| 682 | // Hidden permalink box which has replaced slugdiv metabox |
| 683 | $('#new_post_name').val( $('#editable-post-name-full').html() ); |
| 684 | |
682 | 685 | // permalink |
683 | 686 | if ( $('#edit-slug-box').length ) { |
684 | 687 | editPermalink = function(post_id) { |
… |
… |
jQuery(document).ready( function($) { |
691 | 694 | if ( new_slug == $('#editable-post-name-full').text() ) { |
692 | 695 | return $('.cancel', '#edit-slug-buttons').click(); |
693 | 696 | } |
| 697 | $('#new_post_name').val( new_slug ); // hidden input field (which replaced old slugdiv metabox) - ensure value is same as what is entered in fancy ui |
694 | 698 | $.post(ajaxurl, { |
695 | 699 | action: 'sample-permalink', |
696 | 700 | post_id: post_id, |