Ticket #18523: 18523.diff
File 18523.diff, 5.2 KB (added by , 12 years ago) |
---|
-
src/wp-admin/includes/post.php
1097 1097 } 1098 1098 } 1099 1099 1100 $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>'; 1100 $post_name_html = '<span id="editable-post-name" title="' . $title . '">'; 1101 $post_name_html .= '<span class="hide-if-no-js">' . $post_name_abridged . '</span>'; 1102 $post_name_html .= '<input class="hide-if-js" name="post_name" type="text" value="' . $post_name . '" />'; 1103 $post_name_html .= '</span>'; 1104 1101 1105 $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); 1102 1106 $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink); 1103 1107 $return = '<strong>' . __('Permalink:') . "</strong>\n"; -
src/wp-admin/includes/meta-boxes.php
581 581 } 582 582 583 583 /** 584 * Display slug form fields.585 *586 * @since 2.6.0587 *588 * @param object $post589 */590 function post_slug_meta_box($post) {591 ?>592 <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 <?php594 }595 596 /**597 584 * Display form field with list of authors. 598 585 * 599 586 * @since 2.6.0 -
src/wp-admin/includes/screen.php
95 95 // Hide slug boxes by default 96 96 if ( $use_defaults ) { 97 97 $hidden = array(); 98 if ( 'post' == $screen->base ) { 99 if ( 'post' == $screen->post_type || 'page' == $screen->post_type || 'attachment' == $screen->post_type ) 100 $hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv'); 101 else 102 $hidden = array( 'slugdiv' ); 98 if ( 'post' == $screen->base && in_array( $screen->post_type, array( 'post', 'page', 'attachment' ) ) ) { 99 $hidden = array( 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv' ); 103 100 } 104 101 $hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen ); 105 102 } -
src/wp-admin/js/post.js
721 721 return false; 722 722 }); 723 723 724 for ( i = 0; i < full.length; ++i ) { 725 if ( '%' == full.charAt(i) ) 726 c++; 727 } 728 729 slug_value = ( c > full.length / 4 ) ? '' : full; 730 e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e) { 724 $('span', e).hide(); 725 $('input', e).show().keypress(function(e) { 731 726 var key = e.keyCode || 0; 732 727 // on enter, just save the new slug, don't save the post 733 728 if ( 13 == key ) { -
src/wp-admin/edit-form-advanced.php
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'); … … 369 366 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : ''; 370 367 $shortlink = wp_get_shortlink($post->ID, 'post'); 371 368 if ( !empty($shortlink) ) 372 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';369 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small hide-if-no-js" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 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; 376 373 ?> 377 <div id="edit-slug-box" class="hide-if-no-js">374 <div id="edit-slug-box"> 378 375 <?php 379 376 if ( $has_sample_permalink ) 380 377 echo $sample_permalink_html;