Skip to content

Instantly share code, notes, and snippets.

@CarlosLongarela
Created September 30, 2019 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CarlosLongarela/14778869ebd07bf1a7ef71d31eaebcee to your computer and use it in GitHub Desktop.
Save CarlosLongarela/14778869ebd07bf1a7ef71d31eaebcee to your computer and use it in GitHub Desktop.
Hide Pods Admin Menu if logged user is different that "username"
/**
* Hide Pods Admin Menu if logged user is different that "username".
*/
function css_hide_pods_noncl() {
global $current_user;
if ( 'username' !== $current_user->user_login ) {
echo '<style type="text/css">#toplevel_page_pods{display:none!important;}</style>';
}
}
add_action( 'admin_enqueue_scripts', 'css_hide_pods_noncl' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment