Created
January 20, 2016 08:07
-
-
Save MrVibe/59d1a3dc3cef94f3907c to your computer and use it in GitHub Desktop.
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
add_action('template_redirect','wplms_hide_general_pages_for_students',10); | |
function wplms_hide_general_pages_for_students(){ | |
if(is_user_logged_in() && is_page() && !current_user_can('edit_posts')){ | |
$user_id=get_current_user_id(); | |
bp_core_redirect( apply_filters ( 'wplms_registeration_redirect_url', bp_core_get_user_domain( $user_id ), $user_id ) ); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where you should place the code in functions.php?