Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/17/2015 03:59:12 PM (9 years ago)
Author:
mercime
Message:

Groups Widget: Add 'id' attribute to input field and bind to label.

Accessibility fix adds dynamic 'id' value which also replaces the old
'for' value in order to avoid duplicate 'ids' in DOM when more than
one Groups Widget is added to a theme's available widget areas. This
also unwraps the label tag from the select field.

See #6623.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-widgets.php

    r10116 r10117  
    180180
    181181        <p>
    182             <label for="bp-groups-widget-groups-default"><?php _e('Default groups to show:', 'buddypress'); ?>
    183             <select name="<?php echo $this->get_field_name( 'group_default' ); ?>">
     182            <label for="<?php echo $this->get_field_id( 'group_default' ); ?>"><?php _e('Default groups to show:', 'buddypress'); ?></label>
     183            <select name="<?php echo $this->get_field_name( 'group_default' ); ?>" id="<?php echo $this->get_field_id( 'group_default' ); ?>">
    184184                <option value="newest" <?php if ( $group_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option>
    185185                <option value="active" <?php if ( $group_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option>
    186186                <option value="popular"  <?php if ( $group_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option>
    187187            </select>
    188             </label>
    189188        </p>
    190189    <?php
Note: See TracChangeset for help on using the changeset viewer.