WordPress.org

Make WordPress Core

Ticket #18306: 18306.2.diff

File 18306.2.diff, 3.6 KB (added by scribu, 4 years ago)
  • wp-admin/css/wp-admin.dev.css

    diff --git wp-admin/css/wp-admin.dev.css wp-admin/css/wp-admin.dev.css
    index b9eea7f..30588ca 100644
    input#link_url { 
    28012801        padding: 0 7px; 
    28022802} 
    28032803 
     2804#sample-permalink a { 
     2805        text-decoration: none; 
     2806} 
     2807 
    28042808#editable-post-name-full { 
    28052809        display: none; 
    28062810} 
  • wp-admin/includes/post.php

    diff --git wp-admin/includes/post.php wp-admin/includes/post.php
    index 9098d2f..f39b212 100644
    function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { 
    11301130        } 
    11311131 
    11321132        if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) { 
     1133                if ( isset( $view_post ) ) 
     1134                        $permalink = "<a href='$permalink' title='$view_post' target='_blank'>$permalink</a>"; 
     1135 
    11331136                $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n"; 
    11341137                if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) 
    11351138                        $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n"; 
    1136                 if ( isset($view_post) ) 
    1137                         $return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n"; 
    11381139 
    11391140                $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 
    11401141 
    function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { 
    11551156                } 
    11561157        } 
    11571158 
    1158         $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>'; 
     1159        $post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>'; 
    11591160        $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); 
    11601161        $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink); 
     1162        if ( isset( $view_post ) ) 
     1163                $display_link = "<a href='$view_link' title='$view_post' target='_blank'>$display_link</a>"; 
     1164 
    11611165        $return =  '<strong>' . __('Permalink:') . "</strong>\n"; 
    11621166        $return .= '<span id="sample-permalink">' . $display_link . "</span>\n"; 
    11631167        $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages. 
    11641168        $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"; 
    11651169        $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n"; 
    1166         if ( isset($view_post) ) 
    1167                 $return .= "<span id='view-post-btn'><a href='$view_link' class='button' target='_blank'>$view_post</a></span>\n"; 
    1168  
    11691170        $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 
    11701171 
    11711172        return $return; 
  • wp-admin/js/post.dev.js

    diff --git wp-admin/js/post.dev.js wp-admin/js/post.dev.js
    index 51bee06..6cb26be 100644
     
    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) { 
    jQuery(document).ready( function($) { 
    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