-
-
Save bhubbard/319443e8805119a7ce4e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
// Remove all evidence of WP Engine from the Dashboard, unless the logged in user is "wpengine" | |
$user = wp_get_current_user(); | |
if ( $user->user_login != 'wpengine' ) { | |
add_action( 'admin_init', 'jpry_remove_menu_pages' ); | |
add_action( 'admin_bar_menu', 'jpry_remove_admin_bar_links', 999 ); | |
} | |
/** | |
* Remove the WP Engine menu page | |
*/ | |
function jpry_remove_menu_pages() { | |
remove_menu_page( 'wpengine-common' ); | |
} | |
/** | |
* Remove the "WP Engine Quick Links" from the menu bar | |
*/ | |
function jpry_remove_admin_bar_links( $wp_admin_bar ) { | |
$wp_admin_bar->remove_node( 'wpengine_adminbar' ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment