Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wp-user-manager/04738893f2c5c6a75044696c63c8bf75 to your computer and use it in GitHub Desktop.
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
<?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