WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/26/2013 04:05:46 PM (6 years ago)
Author:
ryan
Message:

Don't show the "Get Shortlink" button for pages with a ?page_id=x permalink.

Props sillybean
fixes #14760

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r25030 r25122  
    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 ) && $shortlink !== get_permalink( $post->ID ) )
     371$permalink = get_permalink( $post->ID );
     372if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )
    372373    $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>';
    373374
Note: See TracChangeset for help on using the changeset viewer.