-
-
Save aaronstpierre/4bea728f56480f08a3b7695bb1fed12f to your computer and use it in GitHub Desktop.
Remove WP Engine info from WP Dashboard
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