Ticket #33495: 33495.diff
File 33495.diff, 1.6 KB (added by , 9 years ago) |
---|
-
src/wp-admin/edit-form-advanced.php
569 569 <?php 570 570 if ( $viewable ) : 571 571 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : ''; 572 $shortlink = wp_get_shortlink($post->ID, 'post');573 572 574 if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) ) 575 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 573 // As of 4.4, the Get Shortlink button is hidden by default. 574 if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) { 575 $shortlink = wp_get_shortlink($post->ID, 'post'); 576 576 577 if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) ) { 578 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 579 } 580 } 581 577 582 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { 578 583 $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; 579 584 ?>