Repository navigation
Expand file tree
/
Copy pathminimize-adminbar.php
More file actions
56 lines (49 loc) · 1.83 KB
/
Copy pathminimize-adminbar.php
File metadata and controls
56 lines (49 loc) · 1.83 KB
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
56
<?php
/**
* Plugin Name: Minimize Admin Bar
* Description: This plugin lets you minimize WP admin bar so that you can work with your content with less distraction.
* Version: 1.0.0
* Requires at least: 6.9
* Requires PHP: 8.0
* Author: Bharat Thapa
* Author URI: https://bharatt.com.np
* Text Domain: minimize-adminbar
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*
* @package MinimizeAdminBar
*/
/*
* Minimize Admin Bar is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 3, as
* published by the Free Software Foundation.
*
* Minimize Admin Bar 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.
*
* You should have received a copy of the GNU General Public License
* along with Minimize Admin Bar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
defined( 'ABSPATH' ) || exit;
! class_exists( 'Minimize_AdminBar' ) || exit;
define( 'MAB_PLUGIN_FILE', __FILE__ );
define( 'MAB_PLUGIN_BASENAME', plugin_basename( MAB_PLUGIN_FILE ) );
define( 'MAB_PLUGIN_PATH', dirname( MAB_PLUGIN_FILE ) . '/' );
define( 'MAB_PLUGIN_URL', plugins_url( '/', MAB_PLUGIN_FILE ) );
define( 'MAB_PLUGIN_VERSION', '1.0.0' );
require_once MAB_PLUGIN_PATH . 'inc/class-minimize-adminbar.php';
/**
* Bootstrap and run the plugin.
*
* @return void
*/
function minimize_adminbar_init(): void {
if ( ! is_user_logged_in() ) {
return;
}
new Minimize_AdminBar();
}
add_action( 'plugins_loaded', 'minimize_adminbar_init' );