Skip to content

Instantly share code, notes, and snippets.

@Sharifur
Last active September 10, 2019 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Sharifur/1b3cc720a102376edfc4b06ff39a8af5 to your computer and use it in GitHub Desktop.
Save Sharifur/1b3cc720a102376edfc4b06ff39a8af5 to your computer and use it in GitHub Desktop.
// add_filter('show_admin_bar','codingeek_show_admin_bar');
function codingeek_check_user_validation(){
$current_user = wp_get_current_user();
if ( in_array('subscriber', $current_user)) {
//have to write code for subscriber
show_admin_bar( false ); // for hide adminbar
};
}
add_action('wp_login','codingeek_check_user_validation');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment