bp_xprofile_grant_bp_xprofile_change_field_visibility_for_logged_out_users( bool $user_can, int $user_id, string $capability )

Grant the ‘bp_xprofile_change_field_visibility’ cap to logged-out users.


Parameters Parameters

$user_can

(bool) (Required)

$user_id

(int) (Required)

$capability

(string) (Required)


Top ↑

Return Return

(bool)


Source Source

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

function bp_xprofile_grant_bp_xprofile_change_field_visibility_for_logged_out_users( $user_can, $user_id, $capability ) {
	if ( 'bp_xprofile_change_field_visibility' === $capability && 0 === $user_id ) {
		$field_id = bp_get_the_profile_field_id();
		if ( $field_id && $field = xprofile_get_field( $field_id, null, false ) ) {
			$user_can = 'allowed' === $field->allow_custom_visibility;
		}
	}

	return $user_can;
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.7.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.