Make WordPress Core

Ticket #27726: 27726.diff

File 27726.diff, 1.3 KB (added by MikeHansenMe, 12 years ago)

Patched based on comment and minor code standards improvement

  • src/wp-admin/edit-form-advanced.php

     
    447447</div>
    448448<div class="inside">
    449449<?php
    450 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
    451 $shortlink = wp_get_shortlink($post->ID, 'post');
     450$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : '';
     451$shortlink = wp_get_shortlink( $post->ID, 'post' );
    452452$permalink = get_permalink( $post->ID );
    453 if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )
     453if ( !empty( $shortlink ) && $permalink !== home_url( '?page_id=' . $post->ID ) ) {
    454454    $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>';
    455 
     455}
    456456if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
    457457        $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
    458458?>