Make WordPress Core

Ticket #27726: 27726.2.diff

File 27726.2.diff, 1.7 KB (added by MikeHansenMe, 11 years ago)
  • src/wp-admin/edit-form-advanced.php

     
    495495?>
    496496<div class="inside">
    497497<?php
    498 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
    499 $shortlink = wp_get_shortlink($post->ID, 'post');
     498$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : '';
     499$shortlink = wp_get_shortlink( $post->ID, 'post' );
    500500
    501 if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )
    502     $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>';
     501if ( ! empty( $shortlink ) && $permalink !== home_url( '?page_id=' . $post->ID ) ) {
     502        $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>';
     503}
    503504
    504 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
     505if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
    505506        $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
    506507?>
    507508        <div id="edit-slug-box" class="hide-if-no-js">