Make WordPress Core

Ticket #18306: 18306.diff

File 18306.diff, 3.5 KB (added by scribu, 13 years ago)
  • wp-admin/includes/post.php

     
    11651165        }
    11661166
    11671167        if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
     1168                if ( isset($view_post) )
     1169                        $permalink = "<a href='$permalink' title='$view_post' target='_blank'>$permalink</a>";
     1170
    11681171                $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n";
    11691172                if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
    11701173                        $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
    1171                 if ( isset($view_post) )
    1172                         $return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n";
    11731174
    11741175                $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
    11751176
     
    11901191                }
    11911192        }
    11921193
    1193         $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
     1194        $post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>';
    11941195        $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
    11951196        $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
     1197        if ( isset($view_post) )
     1198                $display_link = "<a href='$view_link' title='$view_post' target='_blank'>$display_link</a>";
     1199
    11961200        $return =  '<strong>' . __('Permalink:') . "</strong>\n";
    11971201        $return .= '<span id="sample-permalink">' . $display_link . "</span>\n";
    11981202        $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
    11991203        $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
    12001204        $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
    1201         if ( isset($view_post) )
    1202                 $return .= "<span id='view-post-btn'><a href='$view_link' class='button' target='_blank'>$view_post</a></span>\n";
    1203 
    12041205        $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
    12051206
    12061207        return $return;
  • wp-admin/js/post.dev.js

     
    1 var tagBox, commentsBox, editPermalink, makeSlugeditClickable, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint;
     1var tagBox, commentsBox, editPermalink, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint;
    22
    33// return an array with any duplicate, whitespace or values removed
    44function array_unique_noempty(a) {
     
    591591                                real_slug.val(this.value);
    592592                        }).focus();
    593593                }
    594 
    595                 makeSlugeditClickable = function() {
    596                         $('#editable-post-name').click(function() {
    597                                 $('#edit-slug-buttons').children('.edit-slug').click();
    598                         });
    599                 }
    600                 makeSlugeditClickable();
    601594        }
    602595
    603596        // word count
  • wp-admin/css/wp-admin.dev.css

     
    22702270        padding: 0 7px;
    22712271}
    22722272
     2273#editable-post-name {
     2274        text-decoration: underline;
     2275}
     2276
    22732277#editable-post-name-full {
    22742278        display: none;
    22752279}