Created
October 16, 2019 15:12
-
-
Save wp-user-manager/04738893f2c5c6a75044696c63c8bf75 to your computer and use it in GitHub Desktop.
WP User Manager - Allow admins to view profiles when other members are not allowed to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpum_get_option_members_can_view_profiles', 'my_wpum_get_option_members_can_view_profiles' ); | |
function my_wpum_get_option_members_can_view_profiles( $value ) { | |
if ( ! is_user_logged_in() ) { | |
return $value; | |
} | |
if ( ! current_user_can( 'manage_options' ) ) { | |
return $value; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment