From 194e456aa4148b441f3e8d9b94ad9f4774e21cc7 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Fri, 19 Nov 2021 22:54:34 +0000 Subject: [PATCH] Editor: Add missing label to `new-post-slug` input on Classic Editor. Previously, the input for changing the permalink of a post does not have a label in the Classic Editor. This change adds a visually hidden label. It also makes sure browsers do not run spellcheck on the input field. Props sabernhardt. Fixes #53725. git-svn-id: https://develop.svn.wordpress.org/trunk@52225 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/admin/post.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/_enqueues/admin/post.js b/src/js/_enqueues/admin/post.js index b0fca99135..9a40cc7d23 100644 --- a/src/js/_enqueues/admin/post.js +++ b/src/js/_enqueues/admin/post.js @@ -972,7 +972,7 @@ jQuery( function($) { * @return {void} */ function editPermalink() { - var i, slug_value, + var i, slug_value, slug_label, $el, revert_e, c = 0, real_slug = $('#post_name'), @@ -1048,8 +1048,9 @@ jQuery( function($) { c++; } slug_value = ( c > full.length / 4 ) ? '' : full; + slug_label = __( 'URL Slug' ); - $el.html( '' ).children( 'input' ).on( 'keydown', function( e ) { + $el.html( '' ).children( 'input' ).on( 'keydown', function( e ) { var key = e.which; // On [Enter], just save the new slug, don't save the post. if ( 13 === key ) {