Filter: um_profile_can_view_main

apply_filters( 'um_profile_can_view_main', $can_view, $profile_id ) → {int}

Filters user's ability to view a profile

Parameters:
Name Type Description
$can_view int

Can view profile. It's -1 by default.

$profile_id int

User Profile ID.

Since:
  • 1.3.x
Source:
Returns:

Can view profile. Set it to -1 for displaying and vice versa to hide.

Type
int
Example

Make profile hidden.

function my_profile_can_view_main( $can_view, $profile_id ) {
    $can_view = 1; // make profile hidden.
    return $can_view;
}
add_filter( 'um_profile_can_view_main', 'my_profile_can_view_main', 10, 2 );