Skip to content

Instantly share code, notes, and snippets.

@MrVibe
Created January 20, 2016 08:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrVibe/59d1a3dc3cef94f3907c to your computer and use it in GitHub Desktop.
Save MrVibe/59d1a3dc3cef94f3907c to your computer and use it in GitHub Desktop.
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;
}
}
@FranciscoHV
Copy link

Where you should place the code in functions.php?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment