mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
wp_get_shortlink() improvements.
* Return shortlinks for pages and public CPTs. * Return shortlinks even when cruft-free links are not enabled. * Unit tests Props sillybean, layotte, cais fixes #18632 see #14760 git-svn-id: https://develop.svn.wordpress.org/trunk@25030 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -368,7 +368,7 @@ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
||||
<?php
|
||||
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
|
||||
$shortlink = wp_get_shortlink($post->ID, 'post');
|
||||
if ( !empty($shortlink) )
|
||||
if ( !empty( $shortlink ) && $shortlink !== get_permalink( $post->ID ) )
|
||||
$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>';
|
||||
|
||||
if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
|
||||
|
||||
Reference in New Issue
Block a user