Skip to content

Commit 1fe17a0

Browse files
committed
Settings API: Add ID attributes to section title headings.
1 parent ac186d7 commit 1fe17a0

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/wp-admin/includes/template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ function do_settings_sections( $page ) {
17801780
}
17811781

17821782
if ( $section['title'] ) {
1783-
echo "<h2>{$section['title']}</h2>\n";
1783+
echo '<h2 id="' . esc_attr( $section['id'] ) . '">' . $section['title'] . "</h2>\n";
17841784
}
17851785

17861786
if ( $section['callback'] ) {

src/wp-admin/options-discussion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
<?php do_settings_fields( 'discussion', 'default' ); ?>
212212
</table>
213213

214-
<h2 class="title"><?php _e( 'Avatars' ); ?></h2>
214+
<h2 id="avatars" class="title"><?php _e( 'Avatars' ); ?></h2>
215215

216216
<p><?php _e( 'An avatar is an image that can be associated with a user across multiple websites. In this area, you can choose to display avatars of users who interact with the site.' ); ?></p>
217217

src/wp-admin/options-media.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<form action="options.php" method="post">
5353
<?php settings_fields( 'media' ); ?>
5454

55-
<h2 class="title"><?php _e( 'Image sizes' ); ?></h2>
55+
<h2 id="image-sizes" class="title"><?php _e( 'Image sizes' ); ?></h2>
5656
<p><?php _e( 'The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.' ); ?></p>
5757

5858
<table class="form-table" role="presentation">
@@ -104,14 +104,14 @@
104104
*/
105105
if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) :
106106
?>
107-
<h2 class="title"><?php _e( 'Embeds' ); ?></h2>
107+
<h2 id="embeds" class="title"><?php _e( 'Embeds' ); ?></h2>
108108
<table class="form-table" role="presentation">
109109
<?php do_settings_fields( 'media', 'embeds' ); ?>
110110
</table>
111111
<?php endif; ?>
112112

113113
<?php if ( ! is_multisite() ) : ?>
114-
<h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
114+
<h2 id="uploading-files" class="title"><?php _e( 'Uploading Files' ); ?></h2>
115115
<table class="form-table" role="presentation">
116116
<?php
117117
/*

src/wp-admin/options-permalink.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
/* translators: %s: Permalink structure tag. */
315315
$tag_already_used = __( '%s (already used in permalink structure)' );
316316
?>
317-
<h2 class="title"><?php _e( 'Common Settings' ); ?></h2>
317+
<h2 id="common-settings" class="title"><?php _e( 'Common Settings' ); ?></h2>
318318
<p>
319319
<?php
320320
printf(
@@ -405,7 +405,7 @@ class="button button-secondary"
405405
</tbody>
406406
</table>
407407

408-
<h2 class="title"><?php _e( 'Optional' ); ?></h2>
408+
<h2 id="optional" class="title"><?php _e( 'Optional' ); ?></h2>
409409
<p class="permalink-structure-optional-description">
410410
<?php
411411
printf(

src/wp-admin/options-writing.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
/** This filter is documented in wp-admin/options.php */
157157
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
158158
?>
159-
<h2 class="title"><?php _e( 'Post via email' ); ?></h2>
159+
<h2 id="post-via-email" class="title"><?php _e( 'Post via email' ); ?></h2>
160160
<p>
161161
<?php
162162
printf(
@@ -227,7 +227,7 @@
227227
*/
228228
if ( apply_filters( 'enable_update_services_configuration', true ) ) {
229229
?>
230-
<h2 class="title"><?php _e( 'Update Services' ); ?></h2>
230+
<h2 id="update-services" class="title"><?php _e( 'Update Services' ); ?></h2>
231231

232232
<?php if ( '1' === get_option( 'blog_public' ) ) : ?>
233233

0 commit comments

Comments
 (0)