Permalinks: Add labels for permalink configuration fields.

If the current server configuration doesn't allow WordPress to edit permalink settings, the textarea with new rules to use was not labeled. Add labels and aria-describedby pointing to the field description.
 
Props sabernhardt
Fixes #53142.

git-svn-id: https://develop.svn.wordpress.org/trunk@50830 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson 2021-05-07 23:49:15 +00:00
parent 85f53ca0a6
commit 89989405ae

View File

@ -357,7 +357,7 @@ printf( __( 'If you like, you may enter custom structures for your category and
if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
if ( file_exists( $home_path . 'web.config' ) ) :
?>
<p>
<p id="iis-description-a">
<?php
printf(
/* translators: 1: web.config, 2: Documentation URL, 3: CTRL + a, 4: Element code. */
@ -371,7 +371,7 @@ printf( __( 'If you like, you may enter custom structures for your category and
</p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field( 'update-permalink' ); ?>
<p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
<p><label for="rules"><?php _e( 'Rewrite rules:' ); ?></label><br /><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly" aria-describedby="iis-description-a"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
</form>
<p>
<?php
@ -383,7 +383,7 @@ printf( __( 'If you like, you may enter custom structures for your category and
?>
</p>
<?php else : ?>
<p>
<p id="iis-description-b">
<?php
printf(
/* translators: 1: Documentation URL, 2: web.config, 3: CTRL + a */
@ -396,7 +396,7 @@ printf( __( 'If you like, you may enter custom structures for your category and
</p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field( 'update-permalink' ); ?>
<p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules( true ) ); ?></textarea></p>
<p><label for="rules"><?php _e( 'Rewrite rules:' ); ?></label><br /><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly" aria-describedby="iis-description-b"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules( true ) ); ?></textarea></p>
</form>
<p>
<?php
@ -415,7 +415,7 @@ printf( __( 'If you like, you may enter custom structures for your category and
else :
if ( $permalink_structure && ! $using_index_permalinks && ! $writable && $htaccess_update_required ) :
?>
<p>
<p id="htaccess-description">
<?php
printf(
/* translators: 1: .htaccess, 2: Documentation URL, 3: CTRL + a */
@ -428,7 +428,7 @@ else :
</p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field( 'update-permalink' ); ?>
<p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>
<p><label for="rules"><?php _e( 'Rewrite rules:' ); ?></label><br /><textarea rows="8" class="large-text readonly" name="rules" id="rules" readonly="readonly" aria-describedby="htaccess-description"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>
</form>
<?php endif; ?>
<?php endif; ?>