-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhide-admin-notices.php
More file actions
73 lines (61 loc) · 2.03 KB
/
Copy pathhide-admin-notices.php
File metadata and controls
73 lines (61 loc) · 2.03 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* @link https://pontetlabs.com
* @since 1.0.0
* @package Hide_Admin_Notices
*
* @wordpress-plugin
* Plugin Name: Hide Admin Notices
* Plugin URI: https://pontetlabs.com/hide-admin-notices
* Description: New & improved! Hide – or show – WordPress Dashboard Notices, Messages, Update Nags etc. ... for everything!
* Version: 2.0
* Author: PontetLabs
* Author URI: https://pontetlabs.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: hide-admin-notices
* Domain Path: /languages
*/
/** @noinspection PhpDefineCanBeReplacedWithConstInspection */
use Pontet_Labs\Hide_Admin_Notices\Hide_Admin_Notices;
// Exit if accessed directly.
defined('ABSPATH') or exit;
// Define core constants.
define('HIDE_ADMIN_NOTICES_VERSION', '2.0');
define('HIDE_ADMIN_NOTICES_DIR', plugin_dir_path(__FILE__));
define('HIDE_ADMIN_NOTICES_URL', plugin_dir_url(__FILE__));
define('HIDE_ADMIN_NOTICES_BASENAME', plugin_basename(__FILE__));
require_once HIDE_ADMIN_NOTICES_DIR . 'includes/HideAdminNotices.php';
function autoload_classes()
{
$class_map = array_merge(
include HIDE_ADMIN_NOTICES_DIR . 'vendor/composer/autoload_classmap.php',
);
spl_autoload_register(
function ($class) use ($class_map) {
if (
isset($class_map[$class])
&& (
str_starts_with($class, 'Pontet_Labs')
|| str_starts_with($class, 'Twig')
|| file_exists($class_map[$class])
)
) {
require_once $class_map[$class];
}
},
true,
true
);
}
autoload_classes();
function hide_admin_notices(): bool
{
if (null !== Hide_Admin_Notices::$instance) {
return false;
}
Hide_Admin_Notices::$instance = new Hide_Admin_Notices();
Hide_Admin_Notices::$instance->init();
return true;
}
hide_admin_notices();