Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

#5741 closed enhancement (fixed)

Add a "required" class to the xprofile fields

Reported by: wcuadd's profile WCUADD Owned by: boonebgorges's profile boonebgorges
Milestone: 2.1 Priority: normal
Severity: normal Version:
Component: Extended Profile Keywords:
Cc:

Description

This can currectly be done as a snippet

function add_mandatory_xprofile_field_class( $css_classes ) {
global $profile_template;
if ( bp_get_the_profile_field_is_required() ) $css_classes[] = ‘mandatory’;
return $css_classes;
}
add_filter( ‘bp_field_css_classes’, ‘add_mandatory_xprofile_field_class’ );

but it makes sense to include it directly in the bp_field_css_class() in bp-xprofile-template.php.

Please refer to ticket #5739 to take into account the other sections of the registration form in order to have a "required" class for all the fields in this form whatever section it belongs.

Change History (3)

#1 @WCUADD
10 years ago

  • Component changed from Core to XProfile

#2 @boonebgorges
10 years ago

  • Milestone changed from Awaiting Review to 2.1

Thanks for the report. I'm going to go with the term 'required' rather than 'mandatory' because we use 'required' to describe the field elsewhere in the interface. But the .required class is already in use in BP's stylesheets, so I'm going with 'required-field'. And 'optional-field' will round out the options.

#3 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 8561:

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

Note: See TracTickets for help on using tickets.