Opened 10 years ago
Closed 10 years ago
#5741 closed enhancement (fixed)
Add a "required" class to the xprofile fields
Reported by: | WCUADD | Owned by: | 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)
Note: See
TracTickets for help on using
tickets.
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.