Last active
January 19, 2022 20:52
-
-
Save JPry/2399805 to your computer and use it in GitHub Desktop.
Remove WP Engine info from WP Dashboard
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
<?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
This is great. Here is a modification I came up with if you would like to share:
user_login, $users_allowed)) { 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' ); } ?>