Skip to content

Commit baf6c2b

Browse files
committed
Media: Accessibility: Fix labels in scale tool.
The field for setting width in the media editor scale inputs had an incorrect label. Additionally, both the width and height labels had extraneous adjectives describing the fields. These are not necessary given the `fieldset` and `legend` providing context. Change the 'width' label from 'scale height' to 'Width'. Change the 'height' label from 'scale height' to 'Height'. Props csmcneill, nilambar, tusharaddweb, khokansardar, mukesh27, joedolson, afercia. Fixes #65685. git-svn-id: https://develop.svn.wordpress.org/trunk@62840 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2d1c511 commit baf6c2b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/wp-admin/includes/image-edit.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,17 @@ function wp_image_editor( $post_id, $msg = false ) {
151151
<label for="imgedit-scale-width-<?php echo $post_id; ?>" class="screen-reader-text">
152152
<?php
153153
/* translators: Hidden accessibility text. */
154-
_e( 'scale height' );
154+
_e( 'Width' );
155155
?>
156156
</label>
157157
<input type="number" step="1" min="0" max="<?php echo $meta['width'] ?? ''; ?>" aria-describedby="imgedit-scale-warn-<?php echo $post_id; ?>" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1, this)" value="<?php echo $meta['width'] ?? 0; ?>" />
158158
<span class="imgedit-separator" aria-hidden="true">&times;</span>
159-
<label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale height' ); ?></label>
159+
<label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text">
160+
<?php
161+
/* translators: Hidden accessibility text. */
162+
_e( 'Height' );
163+
?>
164+
</label>
160165
<input type="number" step="1" min="0" max="<?php echo $meta['height'] ?? ''; ?>" aria-describedby="imgedit-scale-warn-<?php echo $post_id; ?>" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo $meta['height'] ?? 0; ?>" />
161166
<button id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary"><?php echo esc_html_x( 'Scale', 'verb' ); ?></button>
162167
</div>

0 commit comments

Comments
 (0)