bp_get_the_profile_field_visibility_level()

Return the visibility level of this field.

Description

Return

(string)

Source

File: bp-xprofile/bp-xprofile-template.php

922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
function bp_get_the_profile_field_visibility_level() {
    global $field;
 
    // On the registration page, values stored in POST should take
    // precedence over default visibility, so that submitted values
    // are not lost on failure.
    if ( bp_is_register_page() && ! empty( $_POST['field_' . $field->id . '_visibility'] ) ) {
        $retval = esc_attr( $_POST['field_' . $field->id . '_visibility'] );
    } else {
        $retval = ! empty( $field->visibility_level ) ? $field->visibility_level : 'public';
    }
 
    /**
     * Filters the profile field visibility level.
     *
     * @since BuddyPress 1.6.0
     *
     * @param string $retval Field visibility level.
     */
    return apply_filters( 'bp_get_the_profile_field_visibility_level', $retval );
}

Changelog

Changelog
Version Description
BuddyPress 1.6.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.