Make WordPress Core

Ticket #14760: 14760-button2.diff

File 14760-button2.diff, 890 bytes (added by sillybean, 11 years ago)
  • wp-admin/edit-form-advanced.php

     
    368368<?php
    369369$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
    370370$shortlink = wp_get_shortlink($post->ID, 'post');
    371 if ( !empty($shortlink) )
     371if ( !empty( $shortlink ) && $shortlink !== get_permalink( $post->ID ) )
    372372    $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>';
    373373
    374374if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {