Skip to:
Content

BuddyPress.org

Changeset 10113


Ignore:
Timestamp:
09/17/2015 03:50:09 PM (11 years ago)
Author:
mercime
Message:

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

See #6625.

File:
1 edited

Legend:

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

    r10112 r10113  
    195195
    196196                <p>
    197                         <label for="bp-core-widget-friends-default"><?php _e( 'Default friends to show:', 'buddypress' ); ?>
    198                         <select name="<?php echo $this->get_field_name( 'friend_default' ) ?>">
     197                        <label for="<?php echo $this->get_field_id( 'friend_default' ) ?>"><?php _e( 'Default friends to show:', 'buddypress' ); ?></label>
     198                        <select name="<?php echo $this->get_field_name( 'friend_default' ) ?>" id="<?php echo $this->get_field_id( 'friend_default' ) ?>">
    199199                                <option value="newest" <?php selected( $friend_default, 'newest' ); ?>><?php _e( 'Newest', 'buddypress' ) ?></option>
    200200                                <option value="active" <?php selected( $friend_default, 'active' );?>><?php _e( 'Active', 'buddypress' ) ?></option>
    201201                                <option value="popular"  <?php selected( $friend_default, 'popular' ); ?>><?php _e( 'Popular', 'buddypress' ) ?></option>
    202202                        </select>
    203                         </label>
    204203                </p>
    205204
Note: See TracChangeset for help on using the changeset viewer.