From 54bf0b713c523fb67d8b28436a87f283ed379407 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 26 Aug 2013 16:06:08 +0000 Subject: [PATCH] Don't show the "Get Shortlink" button for pages with a ?page_id=x permalink. 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 --- wp-admin/edit-form-advanced.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 4fef80f0eb..aba54f6ab5 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -368,7 +368,8 @@ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 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 .= '' . __('Get Shortlink') . ''; if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {