Make WordPress Core

Ticket #18523: 18523.diff

File 18523.diff, 5.2 KB (added by andrewryno, 12 years ago)
  • src/wp-admin/includes/post.php

     
    10971097                }
    10981098        }
    10991099
    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
    11011105        $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
    11021106        $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
    11031107        $return =  '<strong>' . __('Permalink:') . "</strong>\n";
  • src/wp-admin/includes/meta-boxes.php

     
    581581}
    582582
    583583/**
    584  * Display slug form fields.
    585  *
    586  * @since 2.6.0
    587  *
    588  * @param object $post
    589  */
    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 <?php
    594 }
    595 
    596 /**
    597584 * Display form field with list of authors.
    598585 *
    599586 * @since 2.6.0
  • src/wp-admin/includes/screen.php

     
    9595        // Hide slug boxes by default
    9696        if ( $use_defaults ) {
    9797                $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' );
    103100                }
    104101                $hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );
    105102        }
  • src/wp-admin/js/post.js

     
    721721                                return false;
    722722                        });
    723723
    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) {
    731726                                var key = e.keyCode || 0;
    732727                                // on enter, just save the new slug, don't save the post
    733728                                if ( 13 == key ) {
  • src/wp-admin/edit-form-advanced.php

     
    181181if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') )
    182182        add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core');
    183183
    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 
    187184if ( post_type_supports($post_type, 'author') ) {
    188185        if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) )
    189186                add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core');
     
    369366$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
    370367$shortlink = wp_get_shortlink($post->ID, 'post');
    371368if ( !empty($shortlink) )
    372     $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt(&#39;URL:&#39;, 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(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
    373370
    374371if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
    375372        $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
    376373?>
    377         <div id="edit-slug-box" class="hide-if-no-js">
     374        <div id="edit-slug-box">
    378375        <?php
    379376                if ( $has_sample_permalink )
    380377                        echo $sample_permalink_html;