Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#5741 closed enhancement (fixed)

Add a "required" class to the xprofile fields

Reported by: WCUADD Owned by: boonebgorges
Priority: normal Milestone: 2.1
Component: Extended Profile Version:
Severity: normal 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
12 years ago

  • Component CoreXProfile

#2 @boonebgorges
12 years ago

  • Milestone Awaiting Review2.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
12 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

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.