Ticket #16478: 16478-3.patch
File 16478-3.patch, 2.0 KB (added by , 10 years ago) |
---|
-
wp-admin/edit-form-advanced.php
447 447 <div class="inside"> 448 448 <?php 449 449 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : ''; 450 $shortlink = wp_get_shortlink($post->ID, 'post');451 $permalink = get_permalink( $post->ID );452 if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )453 $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>';454 450 455 451 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { 456 452 $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; 457 453 ?> 458 454 <div id="edit-slug-box" class="hide-if-no-js"> 455 459 456 <?php 460 457 if ( $has_sample_permalink ) 461 458 echo $sample_permalink_html; -
wp-admin/includes/post.php
1127 1127 if ( isset($view_post) ) 1128 1128 $return .= "<span id='view-post-btn'><a href='$view_link' class='button button-small'>$view_post</a></span>\n"; 1129 1129 1130 $shortlink = wp_get_shortlink($post->ID, 'post'); 1131 1132 if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) ){ 1133 $return .= '<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>'; 1134 } 1135 1130 1136 $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 1131 1137 1132 1138 return $return;