Changes to Some Extended Profile Input Types in BP 2.6.0

For BuddyPress 2.6.0, the core team worked to improve the structure of several extended profile input field types to improve the accessibility of the fields and also make them easier for developers to style. The field types that have been updated are checkboxes, radio buttons, and date boxes.

All three types have been restructured as <fieldset>s with the label for the field residing in the field set’s <legend>.

Checkboxes and radio buttons options have been wrapped in a new <div> with the class input-options and either checkbox-options or radio-button-options. Additionally, the labels for the individual options have been given the class option-label. These changes taken together should make it much easier to target option labels to apply styling. (Goodbye .selector > label + label to catch option labels!)

Date boxes have similarly gained a wrapper <div> with the classes input-options and datebox-selects around the three selects.

Here are some examples of how the code output for these fields has changed:

<!-- Checkbox inputs, before changes -->
<div class="editfield field_2 field_core-makeup optional-field visibility-public alt field_type_checkbox">
  <div class="checkbox">
    <label for="field_2">Core makeup</label>
    <label for="field_11_0"><input name="field_2[]" id="field_11_0" value="Goat" type="checkbox">Goat</label>
    <label for="field_12_1"><input name="field_2[]" id="field_12_1" value="Rhinoceros" type="checkbox">Rhinoceros</label>
    <label for="field_13_2"><input name="field_2[]" id="field_13_2" value="Slow Loris" type="checkbox">Slow Loris</label>
  </div>
</div>

<!-- Checkbox inputs, after changes -->
<div class="editfield field_2 field_core-makeup optional-field visibility-public alt field_type_checkbox">  
  <fieldset class="checkbox">
    <legend>Core makeup</legend>
    <div id="field_2" class="input-options checkbox-options">
      <label for="field_11_0" class="option-label"><input name="field_2[]" id="field_11_0" value="Goat" type="checkbox">Goat</label>
      <label for="field_12_1" class="option-label"><input name="field_2[]" id="field_12_1" value="Rhinoceros" type="checkbox">Rhinoceros</label>
      <label for="field_13_2" class="option-label"><input name="field_2[]" id="field_13_2" value="Slow Loris" type="checkbox">Slow Loris</label>
    </div>
  </fieldset>
</div>

<!-- Radio button inputs, before changes -->
<div class="editfield field_6 field_home-turf optional-field visibility-public field_type_radio">
  <div class="radio">
    <label for="field_6">Home turf</label>
    <div id="field_6">
      <label for="option_7"><input name="field_6" id="option_7" value="Honali" type="radio">Honali</label>
      <label for="option_8"><input name="field_6" id="option_8" value="Fantastica" type="radio">Fantastica</label>
      <label for="option_9"><input name="field_6" id="option_9" value="Toledo" type="radio">Toledo</label>
    </div>
  </div>
</div>

<!-- Radio button inputs, after changes -->
<div class="editfield field_6 field_home-turf optional-field visibility-public field_type_radio">
  <fieldset class="radio">
    <legend>Home turf</legend>
    <div id="field_6" class="input-options radio-button-options">
      <label for="option_7" class="option-label"><input name="field_6" id="option_7" value="Honali" type="radio">Honali</label>
      <label for="option_8" class="option-label"><input name="field_6" id="option_8" value="Fantastica" type="radio">Fantastica</label>
      <label for="option_9" class="option-label"><input name="field_6" id="option_9" value="Toledo" type="radio">Toledo</label>
    </div>      
  </fieldset>
</div>

<!-- Date box inputs, before changes -->
<div class="editfield field_10 field_birth-date optional-field visibility-public alt field_type_datebox">
  <div class="datebox">
    <label for="field_10_day">Birth date</label>
      
    <label for="field_10_day" class="bp-screen-reader-text">Select day</label>
    <select id="field_10_day" name="field_10_day">
      ...Day options...
    </select>

    <label for="field_10_month" class="bp-screen-reader-text">Select month</label>
    <select id="field_10_month" name="field_10_month">
      ...Month options...
    </select>

    <label for="field_10_year" class="bp-screen-reader-text">Select year</label>
    <select id="field_10_year" name="field_10_year">
      ...Year options...    
    </select>
  </div>
</div>

<!-- Date box inputs, after changes -->
<div class="editfield field_10 field_birth-date optional-field visibility-public alt field_type_datebox">
  <fieldset class="datebox">
    <legend>Birth date</legend>

    <div class="input-options datebox-selects">
      <label for="field_10_day" class="bp-screen-reader-text">Select day</label>
      <select id="field_10_day" name="field_10_day">
        ...Day options...
      </select>

      <label for="field_10_month" class="bp-screen-reader-text">Select month</label>
      <select id="field_10_month" name="field_10_month">
        ...Month options...
      </select>

      <label for="field_10_year" class="bp-screen-reader-text">Select year</label>
      <select id="field_10_year" name="field_10_year">
        ...Year options...
      </select>
    </div>
  </fieldset>
</div>

These changes represent a continued effort to update and improve BP templates and the markup they use. In this case we’ve aimed for improved accessibility by structuring our form markup using meaningful groupings of semantic elements and homogenized rendering across browsers and devices. If you have styled the above-mentioned form controls, please review your styles and make the necessary changes, if any.

Read more about these changes at #7083 and #6678.

#6678, #7083

Dev Chat Summary for May 25, 2016

BuddyPress 2.5.3

@boonebgorges packaged and released BuddyPress 2.5.3 last Tuesday, May 24. This is a maintenance and security release, a recommended upgrade for all BuddyPress installations.

BuddyPress 2.5.4

BuddyPress 2.6.0

@dcavins postponed Beta 1 release last week, along with the RC 1 and 2.6.0 releases. The schedule for this dev cycle is updated as follows:

  • Beta 1: June 1, 2016
  • Release Candidate 1 (string freeze): June 15, 2016
  • 2.6.0 release date: June 22, 2016
  • There are currently 98 tickets in queue (Closed: 88. Open: 10.).

Trac Tickets

Companion Stylesheet – Twentyten and Twentyeleven (#7000) @hnla has committed stylesheets to trunk.

Harmonize structure of radio and check box input groups (#7083) @dcavins requested comments on patch. @im4th mentioned some code changes. @rayisme gave thumbs up. Comments in ticket are welcome.

Autocomplete (#4824) Ticket has been punted for future release. Update: @boonebgorges has committed patch to trunk.

Add a “data-timestamp” attribute to all templates requiring timestamps (#5757) @rayisme has uploaded new patch. Needs polyglot help for time strings output by the JS library are not the same as we currently generate. This ticket has been punted to get localization on point.

`get_group_extras` function doesn’t “respect” the `user_id` variable from `groups_get_groups()` function (#6431) Ticket has not been updated for some time and has been punted to Future Release.

Blogs: Improvements to `bp_blogs_record_existing_blogs()` (#6370) Update: @rayisme has committed the improvements to trunk.

Activity replies posting as new items (#6683) @im4th has patch and requested feedback. Positive feedback from @boonebgorges, @im4th, @dcavins, and @djpaulgibbs. Update: @im4th has punted ticket to Future Release.

Activity link moderation doesn’t output useful error message to end users (#6719) @rayisme has patch. Comments welcome. @djpaul mentioned that patch was good to commit.

Escape HTML in RSS Feeds (#6990) @djpaulgibbs noted that this is a new issue but won’t block Beta 1 and left comments in ticket. Update: @djpaulgibbs has committed fix to trunk.

Can’t set ‘Text size’ in Email Customizer (#7041) Update: @dcavins has committed fix to trunk.

@mentions break instagram oembeds if same username exists on site as instagram (#7084) @djpaulgibbs and @johnjamesjacoby have comments in ticket. @boonebgorges is also looking into this. Update: @dcavins has moved this ticket to upcoming BP 2.5.4.

PHP Notice in Customizer (#7086) Issue when entering the email preview pane in the Customizer. Update: @djpaulgibbs has committed fix to trunk.

Groups: Replace `BP_Group_Member` static method DB queries with updated group membership functions (#7078) Update: @rayisme has committed this enhancement to trunk.

xprofile_updated_profile actions pass different args (#7049) @dcavins will review patch submitted by nickmomrik. Update: @dcavins has committed fix to trunk.

Administrator not able to delete user notifications (#7023) @rayisme has revised patch. Update: The fix has been committed to trunk.

“Full name” field setting doesn’t work on non-primary blog admin in multiblog mode (#7003) Ticket has been punted to Future Release.

Emails: real unsubscribe functionality (#6932) @djpaugibbs will review patch this weekend. Update: New patch uploaded.

BuddyPress Embeds for activity, user profiles, groups (#6772)@rayisme and @im4th have updated patches. Update: New feature has been committed to trunk.

Slack log: https://wordpress.slack.com/archives/buddypress/p1464202837003779

#4824, #5757, #6370, #6431, #6683, #6719, #6772, #6932, #6990, #7000, #7003, #7023, #7041, #7049, #7078, #7083, #7084, #7086, #dev-chat