Created
August 25, 2019 18:26
-
-
Save lynt-smitka/cff79cc29b3b25441dcce84550ae4caf 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
//hide admin bar for subsribers | |
function lynt_hide_admin_bar() { | |
if (current_user_can('subscriber')) show_admin_bar(false); | |
} | |
add_action('after_setup_theme', 'lynt_hide_admin_bar'); | |
//redirect subscribers to homepage after dashboard visit attempt | |
function lynt_block_dashboard() { | |
if (current_user_can('subscriber') && is_admin() && ! wp_doing_ajax() ) { | |
wp_redirect(home_url()); | |
exit; | |
} | |
} | |
add_action('admin_init', 'lynt_block_dashboard'); | |
/* | |
//Customized login message | |
function lynt_login_msg() { | |
return '<p class="message">Message</p>'; | |
} | |
add_filter('login_message', 'lynt_login_msg'); | |
*/ | |
//Allow specific pages only for logged in users: https://gist.github.com/lynt-smitka/935a6b28fcdbc7555277aa7075b6733f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment