Skip to content

Instantly share code, notes, and snippets.

@aaronstpierre
Forked from JPry/remove-wpe-info.php
Created September 23, 2016 19:21
Show Gist options
  • Save aaronstpierre/4bea728f56480f08a3b7695bb1fed12f to your computer and use it in GitHub Desktop.
Save aaronstpierre/4bea728f56480f08a3b7695bb1fed12f to your computer and use it in GitHub Desktop.
Remove WP Engine info from WP Dashboard
<?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