Created
July 27, 2020 03:23
-
-
Save 1naveengiri/32e25f4a88fbec058435fd8a30597550 to your computer and use it in GitHub Desktop.
Geodirectory - Restrict user from checking other user profile
This file contains 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_shortcode( 'gd_access_denied', 'restrict_user_access_for_other_profile' ); | |
function restrict_user_access_for_other_profile( $atts ) { | |
if( !is_uwp_current_user_profile_page() && !current_user_can('administrator') ){ // if its users profile. | |
wp_redirect( home_url() ); exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment