Skip to:
Content

BuddyPress.org

Changeset 8561


Ignore:
Timestamp:
07/08/2014 11:37:26 PM (11 years ago)
Author:
boonebgorges
Message:

Add CSS class to xprofile fields indicating whether they are required.

The new class names are 'required-field' and 'optional-field'.

Fixes #5741

Props WCUADD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r8554 r8561  
    223223        // Set a class with the field name (sanitized)
    224224        $css_classes[] = 'field_' . sanitize_title( $profile_template->field->name );
     225
     226        // Set a class indicating whether the field is required or optional
     227        if ( ! empty( $profile_template->field->is_required ) ) {
     228            $css_classes[] = 'required-field';
     229        } else {
     230            $css_classes[] = 'optional-field';
     231        }
    225232
    226233        if ( $profile_template->current_field % 2 == 1 )
Note: See TracChangeset for help on using the changeset viewer.