forked from nhannd314/flatsome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom-wp-admin.php
55 lines (47 loc) · 1.84 KB
/
custom-wp-admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
if ( is_admin() ) {
$userID = get_current_user_id();
$user_meta = get_userdata( $userID );
$user_role = $user_meta->roles;
if ( $userID != '1' ) {
// Disable wp core Update
define( 'WP_AUTO_UPDATE_CORE', false );
// Disable Theme/Plugin Update
add_filter( 'auto_update_plugin', '__return_false' );
add_filter( 'auto_update_theme', '__return_false' );
// Disable Theme/Plugin Editor
define( 'DISALLOW_FILE_MODS', true );
define( 'DISALLOW_FILE_EDIT', true );
add_action( 'admin_menu', 'foxtail_remove_menus' );
// Remove
add_action( 'admin_menu', 'foxtail_remove_unnecessary_wordpress_menus', 999 );
}
function foxtail_remove_menus() {
remove_menu_page( 'index.php' );
remove_menu_page( 'jetpack' );
// remove_menu_page( 'edit.php' );
remove_menu_page( 'upload.php' );
// remove_menu_page( 'edit.php?post_type=page' );
remove_menu_page( 'edit-comments.php' );
remove_menu_page( 'customize.php' );
remove_menu_page( 'plugins.php' );
// remove_menu_page( 'users.php' );
remove_menu_page( 'tools.php' );
remove_menu_page( 'options-general.php' );
remove_menu_page( 'vc-general' );
remove_menu_page( 'about-ultimate' );
remove_menu_page( 'ninja-forms' );
remove_menu_page( 'loco-translate' );
remove_menu_page( 'wppusher' );
remove_menu_page( 'wp-fast-cache' );
remove_menu_page( 'itsec' );
remove_menu_page( 'about-ultimate' );
}
function foxtail_remove_unnecessary_wordpress_menus() {
global $submenu;
unset( $submenu['themes.php'][6] );
unset( $submenu['themes.php'][20] );
unset( $submenu['themes.php'][22] );
remove_menu_page('edit.php?post_type=acf');
}
}