Skip to content

Instantly share code, notes, and snippets.

@wpbullet
Created February 4, 2017 22:56
Show Gist options
  • Save wpbullet/543f171ebfa3caeff38c3298e4c84850 to your computer and use it in GitHub Desktop.
Save wpbullet/543f171ebfa3caeff38c3298e4c84850 to your computer and use it in GitHub Desktop.
//Disallow direct access
defined( 'ABSPATH' ) or die( 'No Access' );
function wpb_bring_admin_back() {
if ( is_user_logged_in() && current_user_can('manage_options') ) {
add_filter( 'show_admin_bar' , '__return_true' );
show_admin_bar( true );
}
}
add_action( 'wp_loaded', 'wpb_bring_admin_back', 10000 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment