Make WordPress Core

Changeset 7888


Ignore:
Timestamp:
05/04/2008 09:28:12 PM (17 years ago)
Author:
westi
Message:

Add ARIA markup for required fields. Fixes #6914 props MarcoZ.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-category-form.php

    r7887 r7888  
    2727        <tr class="form-field form-required">
    2828            <th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
    29             <td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" /><br />
     29            <td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" aria-required="true" /><br />
    3030            <?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></td>
    3131        </tr>
  • trunk/wp-admin/edit-form-advanced.php

    r7883 r7888  
    223223    <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
    224224    <p id="category-add" class="wp-hidden-child">
    225         <label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" />
     225        <label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
    226226        <label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
    227227        <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
  • trunk/wp-admin/edit-link-category-form.php

    r7887 r7888  
    2727        <tr class="form-field form-required">
    2828            <th scope="row" valign="top"><label for="name"><?php _e('Category name') ?></label></th>
    29             <td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" /></td>
     29            <td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" aria-required="true" /></td>
    3030        </tr>
    3131        <tr class="form-field">
  • trunk/wp-admin/edit-link-form.php

    r7883 r7888  
    106106    <p id="link-category-add" class="wp-hidden-child">
    107107        <label class="hidden" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
    108         <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" />
     108        <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" aria-required="true" />
    109109        <input type="button" id="category-add-sumbit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />
    110110        <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
  • trunk/wp-admin/edit-tag-form.php

    r7887 r7888  
    2727        <tr class="form-field form-required">
    2828            <th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th>
    29             <td><input name="name" id="name" type="text" value="<?php echo attribute_escape($tag->name); ?>" size="40" />
     29            <td><input name="name" id="name" type="text" value="<?php echo attribute_escape($tag->name); ?>" size="40" aria-required="true" />
    3030            <p><?php _e('The name is how the tag appears on your site.'); ?></p></td>
    3131        </tr>
  • trunk/wp-admin/includes/media.php

    r7883 r7888  
    704704
    705705        $required = $field['required'] ? '<abbr title="required" class="required">*</abbr>' : '';
     706        $aria_required = $field['required'] ? " aria-required='true' " : '';
    706707        $class  = $id;
    707708        $class .= $field['required'] ? ' form-required' : '';
     
    711712            $item .= $field[$field['input']];
    712713        elseif ( $field['input'] == 'textarea' ) {
    713             $item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . "</textarea>";
     714            $item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . $aria_required . "</textarea>";
    714715        } else {
    715             $item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "' />";
     716            $item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "'" . $aria_required . "/>";
    716717        }
    717718        if ( !empty($field['helps']) )
     
    10861087                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    10871088            </th>
    1088             <td class="field"><input id="insertonly[src]" name="insertonly[src]" value="" type="text"></td>
     1089            <td class="field"><input id="insertonly[src]" name="insertonly[src]" value="" type="text" aria-required="true"></td>
    10891090        </tr>
    10901091        <tr>
     
    10931094                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    10941095            </th>
    1095             <td class="field"><input id="insertonly[alt]" name="insertonly[alt]" value="" type="text"></td>
     1096            <td class="field"><input id="insertonly[alt]" name="insertonly[alt]" value="" type="text" aria-required="true"></td>
    10961097        </tr>
    10971098        <tr><td></td><td class="help">' . __('Alternate text, e.g. "The Mona Lisa"') . '</td></tr>
     
    11271128                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    11281129            </th>
    1129             <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
     1130            <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
    11301131        </tr>
    11311132        <tr>
     
    11341135                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    11351136            </th>
    1136             <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
     1137            <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
    11371138        </tr>
    11381139        <tr><td></td><td class="help">' . __('Link text, e.g. "Still Alive by Jonathan Coulton"') . '</td></tr>
     
    11551156                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    11561157            </th>
    1157             <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
     1158            <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
    11581159        </tr>
    11591160        <tr>
     
    11621163                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    11631164            </th>
    1164             <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
     1165            <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
    11651166        </tr>
    11661167        <tr><td></td><td class="help">' . __('Link text, e.g. "Lucy on YouTube"') . '</td></tr>
     
    11831184                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    11841185            </th>
    1185             <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
     1186            <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
    11861187        </tr>
    11871188        <tr>
     
    11901191                <span class="alignright"><abbr title="required" class="required">*</abbr></span>
    11911192            </th>
    1192             <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
     1193            <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
    11931194        </tr>
    11941195        <tr><td></td><td class="help">' . __('Link text, e.g. "Ransom Demands (PDF)"') . '</td></tr>
  • trunk/wp-admin/users.php

    r7883 r7888  
    406406    <tr class="form-field form-required">
    407407        <th scope="row"><label for="user_login"><?php _e('Username (required)') ?></label><input name="action" type="hidden" id="action" value="adduser" /></th>
    408         <td ><input name="user_login" type="text" id="user_login" value="<?php echo $new_user_login; ?>" /></td>
     408        <td ><input name="user_login" type="text" id="user_login" value="<?php echo $new_user_login; ?>" aria-required="true" /></td>
    409409    </tr>
    410410    <tr class="form-field">
  • trunk/wp-content/themes/default/comments.php

    r7360 r7888  
    7979<?php else : ?>
    8080
    81 <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
     81<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
    8282<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
    8383
    84 <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
     84<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    8585<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
    8686
Note: See TracChangeset for help on using the changeset viewer.