Skip to:
Content

BuddyPress.org

Changeset 10121


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

Members Widget: Add 'id' attribute to input 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 Members Widget is added to a theme's available widget areas. This
also unwraps the label tag from the select field.

See #6624.

File:
1 edited

Legend:

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

    r10120 r10121  
    217217
    218218        <p>
    219             <label for="bp-core-widget-groups-default"><?php esc_html_e( 'Default members to show:', 'buddypress' ); ?>
    220                 <select name="<?php echo $this->get_field_name( 'member_default' ) ?>">
    221                     <option value="newest"  <?php if ( 'newest'  === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Newest',  'buddypress' ); ?></option>
    222                     <option value="active"  <?php if ( 'active'  === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Active',  'buddypress' ); ?></option>
    223                     <option value="popular" <?php if ( 'popular' === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Popular', 'buddypress' ); ?></option>
    224                 </select>
    225             </label>
     219            <label for="<?php echo $this->get_field_id( 'member_default' ) ?>"><?php esc_html_e( 'Default members to show:', 'buddypress' ); ?></label>
     220            <select name="<?php echo $this->get_field_name( 'member_default' ) ?>" id="<?php echo $this->get_field_id( 'member_default' ) ?>">
     221                <option value="newest"  <?php if ( 'newest'  === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Newest',  'buddypress' ); ?></option>
     222                <option value="active"  <?php if ( 'active'  === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Active',  'buddypress' ); ?></option>
     223                <option value="popular" <?php if ( 'popular' === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Popular', 'buddypress' ); ?></option>
     224            </select>
    226225        </p>
    227226
Note: See TracChangeset for help on using the changeset viewer.