diff --git wp-admin/edit-form-advanced.php wp-admin/edit-form-advanced.php
index 8dc4815..59a5445 100644
|
|
if ( post_type_supports($post_type, 'comments') ) |
204 | 204 | if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') ) |
205 | 205 | add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core'); |
206 | 206 | |
207 | | if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) |
208 | | add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core'); |
209 | | |
210 | 207 | if ( post_type_supports($post_type, 'author') ) { |
211 | 208 | if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) |
212 | 209 | add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core'); |
… |
… |
if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_ur |
455 | 452 | |
456 | 453 | if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { |
457 | 454 | $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; |
| 455 | |
| 456 | $no_js_permalink = get_sample_permalink($post->ID); |
| 457 | $up_to_permalink = str_replace( '%pagename%/', '', $no_js_permalink[0] ); |
| 458 | $up_to_permalink = str_replace( '%postname%/', '', $up_to_permalink ); |
| 459 | $slug = $no_js_permalink[1]; |
458 | 460 | ?> |
| 461 | |
| 462 | <div class="hide-if-js"> |
| 463 | <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" /> |
| 464 | </div> |
| 465 | |
459 | 466 | <div id="edit-slug-box" class="hide-if-no-js"> |
460 | 467 | <?php |
461 | 468 | if ( $has_sample_permalink ) |
diff --git wp-admin/includes/meta-boxes.php wp-admin/includes/meta-boxes.php
index b5bc75b..a043ff1 100644
|
|
function post_comment_meta_box( $post ) { |
658 | 658 | * @param object $post |
659 | 659 | */ |
660 | 660 | function post_slug_meta_box($post) { |
| 661 | _deprecated_function( __FUNCTION__, '4.0' ); |
661 | 662 | /** This filter is documented in wp-admin/edit-tag-form.php */ |
662 | 663 | ?> |
663 | 664 | <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 ) ); ?>" /> |
diff --git wp-admin/js/post.js wp-admin/js/post.js
index 21f28e7..02f955f 100644
|
|
jQuery(document).ready( function($) { |
875 | 875 | }); |
876 | 876 | } // end submitdiv |
877 | 877 | |
| 878 | // Hidden permalink box which has replaced slugdiv metabox |
| 879 | $('#new_post_name').val( $('#editable-post-name-full').html() ); |
| 880 | |
878 | 881 | // permalink |
879 | 882 | function editPermalink() { |
880 | 883 | var i, slug_value, |
… |
… |
jQuery(document).ready( function($) { |
894 | 897 | if ( new_slug == $('#editable-post-name-full').text() ) { |
895 | 898 | return $('#edit-slug-buttons .cancel').click(); |
896 | 899 | } |
| 900 | |
| 901 | // hidden input field (which replaced old slugdiv metabox) - ensure value is same as what is entered in fancy ui |
| 902 | $('#new_post_name').val( new_slug ); |
| 903 | |
897 | 904 | $.post(ajaxurl, { |
898 | 905 | action: 'sample-permalink', |
899 | 906 | post_id: postId, |