diff --git a/src/js/_enqueues/wp/media/editor.js b/src/js/_enqueues/wp/media/editor.js index 02c993fd4bbef..1097bca966fdb 100644 --- a/src/js/_enqueues/wp/media/editor.js +++ b/src/js/_enqueues/wp/media/editor.js @@ -703,15 +703,19 @@ * Update the featured image id when the 'remove' link is clicked. */ init: function() { - $('#postimagediv').on( 'click', '#set-post-thumbnail', function( event ) { - event.preventDefault(); - // Stop propagation to prevent thickbox from activating. - event.stopPropagation(); - - wp.media.featuredImage.frame().open(); - }).on( 'click', '#remove-post-thumbnail', function() { - wp.media.featuredImage.remove(); - return false; + $('#postimagediv').on( 'click keyup keydown', '#set-post-thumbnail', function( event ) { + if ( ( event.type === 'keyup' && event.key === ' ' ) || ( event.type === 'keydown' && event.key === 'Enter' ) || event.type === 'click' ) { + event.preventDefault(); + // Stop propagation to prevent thickbox from activating. + event.stopPropagation(); + + wp.media.featuredImage.frame().open(); + } + }).on( 'click keyup keydown', '#remove-post-thumbnail', function( event ) { + if ( ( event.type === 'keyup' && event.key === ' ' ) || ( event.type === 'keydown' && event.key === 'Enter' ) || event.type === 'click' ) { + wp.media.featuredImage.remove(); + return false; + } }); } }; diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index eb0029a556169..de5aa4fb7d0fa 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -1644,7 +1644,7 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { $post = get_post( $post ); $post_type_object = get_post_type_object( $post->post_type ); - $set_thumbnail_link = '
'; + $set_thumbnail_link = ''; $upload_iframe_src = get_upload_iframe_src( 'image', $post->ID ); $content = sprintf( @@ -1683,7 +1683,7 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { $thumbnail_html ); $content .= ''; - $content .= ''; + $content .= ''; } }