Accessibility: Make the Get Shortlink button be a real button.

Worth noting, as of WordPress 4.4, the Get Shortlink button is hidden by default
but it can be restored via filters.

Props Cheffheid.
See #26504.
Fixes #40448.


git-svn-id: https://develop.svn.wordpress.org/trunk@40578 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2017-05-07 11:46:52 +00:00
parent cc661013cf
commit cd239819b9

View File

@ -582,7 +582,7 @@ if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) {
$shortlink = wp_get_shortlink($post->ID, 'post');
if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) ) {
$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>';
$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>';
}
}