Skip to:
Content

BuddyPress.org

Changeset 11834


Ignore:
Timestamp:
01/28/2018 05:03:59 PM (21 months ago)
Author:
djpaul
Message:

xprofile: add HTML required attribute to mandatory profile fields.

The value is not added for users with bp_moderate as those users can already bypass field requirements..

Fixes #7667

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type.php

    r11127 r11834  
    511511        if ( bp_get_the_profile_field_is_required() ) {
    512512            $r['aria-required'] = 'true';
     513
     514            // Moderators can bypass field requirements.
     515            if ( ! bp_current_user_can( 'bp_moderate' ) ) {
     516                $r[] = 'required';
     517            }
    513518        }
    514519
Note: See TracChangeset for help on using the changeset viewer.