Created
January 31, 2013 09:48
-
-
Save jeffikus/4681749 to your computer and use it in GitHub Desktop.
Prevent Sensei Admin Access
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('admin_init', 'sensei_prevent_admin_access'); | |
function sensei_prevent_admin_access() { | |
if ( ! is_ajax() && ! current_user_can('edit_posts') ) { | |
global $woothemes_sensei; | |
wp_safe_redirect(get_permalink(intval( $woothemes_sensei->settings->settings[ 'course_page' ] ))); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment