forked from campusboy87/easy-hide-admin-menu-items
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hide-admin-menu-items.php
45 lines (40 loc) · 1.34 KB
/
hide-admin-menu-items.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
<?php
/**
* Plugin Name: Hide Admin Menu Items
* Plugin URI: https://github.com/campusboy87/hide-admin-menu-items
* Description: Плагин позволяет скрывать выбранные пункты меню.
* Version: 1.1
* Author: campusboy
* Author URI: https://wp-plus.ru/
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Requires PHP: 5.4
* Requires at least: 4.2.0
* Tested up to: 4.9.5
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Инициализирует плагин.
*
* @return void
*/
function hami_init() {
if ( is_admin() && current_user_can( 'manage_options' ) ) {
require __DIR__ . DIRECTORY_SEPARATOR . 'class-hide-admin-menu-items.php';
$plugin = new Hide_Admin_Menu_Items;
$plugin->init();
}
}
add_action( 'plugins_loaded', 'hami_init' );