Changeset 53888
- Timestamp:
- 08/12/2022 12:09:10 PM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r53777 r53888 1704 1704 <tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n 1705 1705 <tr><td colspan='2'><p class='media-types media-types-required-info'>" . 1706 /* translators: %s: Asterisk symbol (*). */ 1707 sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . 1706 wp_required_field_message() . 1708 1707 "</p></td></tr>\n"; 1709 1708 … … 1785 1784 } 1786 1785 1787 $required = $field['required'] ? ' <span class="required">*</span>': '';1786 $required = $field['required'] ? ' ' . wp_required_field_indicator() : ''; 1788 1787 $required_attr = $field['required'] ? ' required' : ''; 1789 1788 $class = $id; … … 1976 1975 1977 1976 $readonly = ! $user_can_edit && ! empty( $field['taxonomy'] ) ? " readonly='readonly' " : ''; 1978 $required = $field['required'] ? ' <span class="required">*</span>': '';1977 $required = $field['required'] ? ' ' . wp_required_field_indicator() : ''; 1979 1978 $required_attr = $field['required'] ? ' required' : ''; 1980 1979 $class = 'compat-field-' . $id; … … 2032 2031 if ( $item ) { 2033 2032 $item = '<p class="media-types media-types-required-info">' . 2034 /* translators: %s: Asterisk symbol (*). */ 2035 sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . 2033 wp_required_field_message() . 2036 2034 '</p>' . 2037 2035 '<table class="compat-attachment-fields">' . $item . '</table>'; … … 2930 2928 <p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p> 2931 2929 <p class="media-types media-types-required-info">' . 2932 /* translators: %s: Asterisk symbol (*). */ 2933 sprintf( __( 'Required fields are marked %s' ), '<span class="required">*</span>' ) . 2930 wp_required_field_message() . 2934 2931 '</p> 2935 2932 <table class="describe ' . $table_class . '"><tbody> 2936 2933 <tr> 2937 2934 <th scope="row" class="label" style="width:130px;"> 2938 <label for="src"><span class="alignleft">' . __( 'URL' ) . '</span> <span class="required">*</span></label>2935 <label for="src"><span class="alignleft">' . __( 'URL' ) . '</span> ' . wp_required_field_indicator() . '</label> 2939 2936 <span class="alignright" id="status_img"></span> 2940 2937 </th> … … 2944 2941 <tr> 2945 2942 <th scope="row" class="label"> 2946 <label for="title"><span class="alignleft">' . __( 'Title' ) . '</span> <span class="required">*</span></label>2943 <label for="title"><span class="alignleft">' . __( 'Title' ) . '</span> ' . wp_required_field_indicator() . '</label> 2947 2944 </th> 2948 2945 <td class="field"><input id="title" name="title" value="" type="text" required /></td> … … 2953 2950 <tr class="image-only"> 2954 2951 <th scope="row" class="label"> 2955 <label for="alt"><span class="alignleft">' . __( 'Alternative Text' ) . '</span> </label>2952 <label for="alt"><span class="alignleft">' . __( 'Alternative Text' ) . '</span> ' . wp_required_field_indicator() . '</label> 2956 2953 </th> 2957 2954 <td class="field"><input id="alt" name="alt" value="" type="text" required /> -
trunk/src/wp-admin/network/site-new.php
r52978 r53888 194 194 } 195 195 ?> 196 <p> 197 <?php 198 printf( 199 /* translators: %s: Asterisk symbol (*). */ 200 __( 'Required fields are marked %s' ), 201 '<span class="required">*</span>' 202 ); 203 ?> 204 </p> 196 <p><?php echo wp_required_field_message(); ?></p> 205 197 <form method="post" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate"> 206 198 <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?> 207 199 <table class="form-table" role="presentation"> 208 200 <tr class="form-field form-required"> 209 <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?> <span class="required">*</span></label></th> 201 <th scope="row"> 202 <label for="site-address"> 203 <?php 204 _e( 'Site Address (URL)' ); 205 echo ' ' . wp_required_field_indicator(); 206 ?> 207 </label> 208 </th> 210 209 <td> 211 210 <?php if ( is_subdomain_install() ) { ?> … … 223 222 </tr> 224 223 <tr class="form-field form-required"> 225 <th scope="row"><label for="site-title"><?php _e( 'Site Title' ); ?> <span class="required">*</span></label></th> 224 <th scope="row"> 225 <label for="site-title"> 226 <?php 227 _e( 'Site Title' ); 228 echo ' ' . wp_required_field_indicator(); 229 ?> 230 </label> 231 </th> 226 232 <td><input name="blog[title]" type="text" class="regular-text" id="site-title" required /></td> 227 233 </tr> … … 258 264 <?php endif; // Languages. ?> 259 265 <tr class="form-field form-required"> 260 <th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ); ?> <span class="required">*</span></label></th> 266 <th scope="row"> 267 <label for="admin-email"> 268 <?php 269 _e( 'Admin Email' ); 270 echo ' ' . wp_required_field_indicator(); 271 ?> 272 </label> 273 </th> 261 274 <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" aria-describedby="site-admin-email" required /></td> 262 275 </tr> -
trunk/src/wp-includes/comment-template.php
r53796 r53888 2355 2355 $checked_attribute = ( $html5 ? ' checked' : ' checked="checked"' ); 2356 2356 2357 // Identify required fields visually. 2358 $required_indicator = ' <span class="required" aria-hidden="true">*</span>'; 2357 // Identify required fields visually and create a message about the indicator. 2358 $required_indicator = ' ' . wp_required_field_indicator(); 2359 $required_text = ' ' . wp_required_field_message(); 2359 2360 2360 2361 $fields = array( … … 2420 2421 } 2421 2422 } 2422 2423 $required_text = sprintf(2424 /* translators: %s: Asterisk symbol (*). */2425 ' <span class="required-field-message" aria-hidden="true">' . __( 'Required fields are marked %s' ) . '</span>',2426 trim( $required_indicator )2427 );2428 2423 2429 2424 /** -
trunk/src/wp-includes/general-template.php
r53846 r53888 5023 5023 5024 5024 /** 5025 * Assigns a visual indicator for required form fields. 5026 * 5027 * @since 6.1.0 5028 * 5029 * @return string Indicator glyph wrapped in a `span` tag. 5030 */ 5031 function wp_required_field_indicator() { 5032 /* translators: Character to identify required form fields. */ 5033 $glyph = __( '*' ); 5034 $indicator = '<span class="required" aria-hidden="true">' . esc_html( $glyph ) . '</span>'; 5035 5036 return $indicator; 5037 } 5038 5039 /** 5040 * Creates a message to explain required form fields. 5041 * 5042 * @since 6.1.0 5043 * 5044 * @return string Message text and glyph wrapped in a `span` tag. 5045 */ 5046 function wp_required_field_message() { 5047 $message = sprintf( 5048 '<span class="required-field-message" aria-hidden="true">%s</span>', 5049 /* translators: %s: Asterisk symbol (*). */ 5050 sprintf( __( 'Required fields are marked %s' ), wp_required_field_indicator() ) 5051 ); 5052 5053 return $message; 5054 } 5055 5056 /** 5025 5057 * Default settings for heartbeat. 5026 5058 *
Note: See TracChangeset
for help on using the changeset viewer.