Make WordPress Core

Ticket #33495: edit-form-advanced-v2.patch

File edit-form-advanced-v2.patch, 1.2 KB (added by grvrulz, 9 years ago)
  • wp-admin/edit-form-advanced.php

     
    537537$shortlink = wp_get_shortlink($post->ID, 'post');
    538538
    539539if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )
    540     $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>';
     540    $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" />';
    541541
     542if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) )
     543    $sample_permalink_html .= '<a href="#" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
     544
    542545if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
    543546        $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
    544547?>