Skip to content

Commit

Permalink
Don't show the "Get Shortlink" button for pages with a ?page_id=x per…
Browse files Browse the repository at this point in the history
…malink.

Props sillybean
fixes #14760

Built from https://develop.svn.wordpress.org/trunk@25122


git-svn-id: http://core.svn.wordpress.org/trunk@25102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
Ryan Boren committed Aug 26, 2013
1 parent c7b00ae commit 54bf0b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wp-admin/edit-form-advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@
<?php
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
$shortlink = wp_get_shortlink($post->ID, 'post');
if ( !empty( $shortlink ) && $shortlink !== get_permalink( $post->ID ) )
$permalink = get_permalink( $post->ID );
if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )
$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>';

if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
Expand Down

0 comments on commit 54bf0b7

Please sign in to comment.