Last active
November 6, 2019 19:49
-
-
Save tjhole/7429004 to your computer and use it in GitHub Desktop.
WORDPRESS: Function - Idiot Proof Admin
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
add_action( 'admin_menu', 'adjust_the_wp_menu', 999 ); | |
function adjust_the_wp_menu() { | |
remove_submenu_page( 'themes.php', 'theme-editor.php'); | |
remove_submenu_page( 'themes.php', 'themes.php'); | |
remove_submenu_page( 'themes.php', 'customize.php'); | |
remove_submenu_page( 'themes.php', 'widgets.php'); | |
remove_submenu_page( 'jetpack', 'jetpack'); | |
remove_submenu_page( 'index.php', 'update-core.php'); | |
} | |
add_action( 'login_head', 'namespace_login_style' ); | |
/** | |
* Replaces the login header logo | |
*/ | |
function namespace_login_style() { | |
echo '<style> | |
body.login { | |
background:#fff!important | |
} | |
.login h1 a { | |
background-size: 274px 63px; | |
width: 100%; | |
background-image: url( ' . get_template_directory_uri() . '/wordpress-logo.png ) !important; | |
}</style>'; | |
} | |
function hide_menu_items() { | |
remove_menu_page( 'edit.php' ); | |
remove_menu_page( 'edit.php?post_type=acf' ); | |
remove_menu_page( 'users.php' ); | |
remove_menu_page( 'themes.php' ); | |
remove_menu_page( 'plugins.php' ); | |
remove_menu_page( 'options-general.php' ); | |
remove_menu_page( 'users.php' ); | |
remove_menu_page( 'edit-comments.php' ); | |
remove_menu_page( 'tools.php' ); | |
} | |
add_action( 'admin_menu', 'hide_menu_items' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment