Changeset 53913
- Timestamp:
- 08/19/2022 11:04:04 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-tag-form.php
r53455 r53913 146 146 <tr class="form-field form-required term-name-wrap"> 147 147 <th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th> 148 <td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" />149 <p class="description" ><?php echo $tax->labels->name_field_description; ?></p></td>148 <td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" aria-describedby="name-description" /> 149 <p class="description" id="name-description"><?php echo $tax->labels->name_field_description; ?></p></td> 150 150 </tr> 151 151 <?php if ( ! global_terms_enabled() ) { ?> … … 168 168 $slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : ''; 169 169 ?> 170 <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" />171 <p class="description" ><?php echo $tax->labels->slug_field_description; ?></p></td>170 <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" aria-describedby="slug-description" /> 171 <p class="description" id="slug-description"><?php echo $tax->labels->slug_field_description; ?></p></td> 172 172 </tr> 173 173 <?php } ?> … … 187 187 'hierarchical' => true, 188 188 'show_option_none' => __( 'None' ), 189 'aria_describedby' => 'parent-description', 189 190 ); 190 191 … … 194 195 ?> 195 196 <?php if ( 'category' === $taxonomy ) : ?> 196 <p class="description" ><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>197 <p class="description" id="parent-description"><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p> 197 198 <?php else : ?> 198 <p class="description" ><?php echo $tax->labels->parent_field_description; ?></p>199 <p class="description" id="parent-description"><?php echo $tax->labels->parent_field_description; ?></p> 199 200 <?php endif; ?> 200 201 </td> … … 203 204 <tr class="form-field term-description-wrap"> 204 205 <th scope="row"><label for="description"><?php _e( 'Description' ); ?></label></th> 205 <td><textarea name="description" id="description" rows="5" cols="50" class="large-text" ><?php echo $tag->description; // textarea_escaped ?></textarea>206 <p class="description" ><?php echo $tax->labels->desc_field_description; ?></p></td>206 <td><textarea name="description" id="description" rows="5" cols="50" class="large-text" aria-describedby="description-description"><?php echo $tag->description; // textarea_escaped ?></textarea> 207 <p class="description" id="description-description"><?php echo $tax->labels->desc_field_description; ?></p></td> 207 208 </tr> 208 209 <?php -
trunk/src/wp-admin/edit-tags.php
r53827 r53913 454 454 <div class="form-field form-required term-name-wrap"> 455 455 <label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label> 456 <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />457 <p ><?php echo $tax->labels->name_field_description; ?></p>456 <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" aria-describedby="name-description" /> 457 <p id="name-description"><?php echo $tax->labels->name_field_description; ?></p> 458 458 </div> 459 459 <?php if ( ! global_terms_enabled() ) : ?> 460 460 <div class="form-field term-slug-wrap"> 461 461 <label for="tag-slug"><?php _e( 'Slug' ); ?></label> 462 <input name="slug" id="tag-slug" type="text" value="" size="40" />463 <p ><?php echo $tax->labels->slug_field_description; ?></p>462 <input name="slug" id="tag-slug" type="text" value="" size="40" aria-describedby="slug-description" /> 463 <p id="slug-description"><?php echo $tax->labels->slug_field_description; ?></p> 464 464 </div> 465 465 <?php endif; // global_terms_enabled() ?> … … 501 501 $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' ); 502 502 503 $dropdown_args['aria_describedby'] = 'parent-description'; 504 503 505 wp_dropdown_categories( $dropdown_args ); 504 506 ?> 505 507 <?php if ( 'category' === $taxonomy ) : ?> 506 <p ><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>508 <p id="parent-description"><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p> 507 509 <?php else : ?> 508 <p ><?php echo $tax->labels->parent_field_description; ?></p>510 <p id="parent-description"><?php echo $tax->labels->parent_field_description; ?></p> 509 511 <?php endif; ?> 510 512 </div> … … 512 514 <div class="form-field term-description-wrap"> 513 515 <label for="tag-description"><?php _e( 'Description' ); ?></label> 514 <textarea name="description" id="tag-description" rows="5" cols="40" ></textarea>515 <p ><?php echo $tax->labels->desc_field_description; ?></p>516 <textarea name="description" id="tag-description" rows="5" cols="40" aria-describedby="description-description"></textarea> 517 <p id="description-description"><?php echo $tax->labels->desc_field_description; ?></p> 516 518 </div> 517 519 -
trunk/src/wp-includes/category-template.php
r53715 r53913 301 301 * @since 4.2.0 Introduced the `value_field` argument. 302 302 * @since 4.6.0 Introduced the `required` argument. 303 * @since 6.1.0 Introduced the `aria_describedby` argument. 303 304 * 304 305 * @param array|string $args { … … 336 337 * @type Walker $walker Walker object to use to build the output. Default empty which results in a 337 338 * Walker_CategoryDropdown instance being used. 339 * @type string $aria_describedby The 'id' of an element that contains descriptive text for the select. 340 * Default empty string. 338 341 * } 339 342 * @return string HTML dropdown list of categories. … … 362 365 'value_field' => 'term_id', 363 366 'required' => false, 367 'aria_describedby' => '', 364 368 ); 365 369 … … 407 411 $required = $parsed_args['required'] ? 'required' : ''; 408 412 413 $aria_describedby_attribute = $parsed_args['aria_describedby'] ? ' aria-describedby="' . esc_attr( $parsed_args['aria_describedby'] ) . '"' : ''; 414 409 415 if ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) { 410 $output = "<select $required name='$name' id='$id' class='$class' $tab_index_attribute>\n";416 $output = "<select $required name='$name' id='$id' class='$class'$tab_index_attribute$aria_describedby_attribute>\n"; 411 417 } else { 412 418 $output = '';
Note: See TracChangeset
for help on using the changeset viewer.