Skip to:
Content

BuddyPress.org

Changeset 5165


Ignore:
Timestamp:
09/20/2011 09:38:40 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Allow super admins to skip the XProfile is_required check. Fixes #3593.

Location:
trunk/bp-xprofile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-functions.php

    r5032 r5165  
    263263    $field = new BP_Xprofile_Field( $field_id );
    264264
    265     if ( (int)$field->is_required )
    266         return true;
    267 
    268     return false;
     265    // Define locale variable(s)
     266    $retval = false;
     267
     268    // Super admins can skip required check
     269    if ( is_super_admin() )
     270        $retval = false;
     271
     272    // All other users will use the field's setting
     273    elseif ( isset( $field->is_required ) )
     274        $retval = $field->is_required;
     275
     276    return (bool) $retval;
    269277}
    270278
  • trunk/bp-xprofile/bp-xprofile-template.php

    r5131 r5165  
    648648        global $field;
    649649
    650         return apply_filters( 'bp_get_the_profile_field_is_required', (int)$field->is_required );
     650        // Define locale variable(s)
     651        $retval = false;
     652
     653        // Super admins can skip required check
     654        if ( is_super_admin() )
     655            $retval = false;
     656
     657        // All other users will use the field's setting
     658        elseif ( isset( $field->is_required ) )
     659            $retval = $field->is_required;
     660
     661        return apply_filters( 'bp_get_the_profile_field_is_required', (bool) $retval );
    651662    }
    652663
Note: See TracChangeset for help on using the changeset viewer.