WordPress.org

Make WordPress Core

Ticket #16478: 16478.diff

File 16478.diff, 2.0 KB (added by solarissmoke, 3 years ago)
  • wp-admin/includes/post.php

     
    11641164        $return .= '‎'; // Fix bi-directional text display defect in RTL languages. 
    11651165        $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"; 
    11661166        $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n"; 
    1167         if ( isset($view_post) ) 
     1167        if ( isset($view_post) )  
    11681168                $return .= "<span id='view-post-btn'><a href='$view_link' class='button' target='_blank'>$view_post</a></span>\n"; 
     1169         
     1170        $shortlink = wp_get_shortlink($post->ID, 'post'); 
     1171        if ( !empty($shortlink) ) 
     1172                $return .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><a href="#" class="button" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 
    11691173 
    11701174        $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 
    11711175 
  • wp-admin/edit-form-advanced.php

     
    249249<div class="inside"> 
    250250<?php 
    251251$sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? get_sample_permalink_html($post->ID) : ''; 
    252 $shortlink = wp_get_shortlink($post->ID, 'post'); 
    253 if ( !empty($shortlink) ) 
    254     $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 
    255252 
    256253if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 
    257254        <div id="edit-slug-box">