Changeset 34556
- Timestamp:
- 09/25/2015 07:53:28 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-advanced.php
r34515 r34556 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 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>'; 572 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 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 } 576 581 577 582 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
Note: See TracChangeset
for help on using the changeset viewer.