PluginProbe ʕ •ᴥ•ʔ
Disable Admin Notices – Hide Dashboard Notifications / 1.4.6
Disable Admin Notices – Hide Dashboard Notifications v1.4.6
1.4.7 1.4.6 1.4.5 trunk 1.0.0 1.0.2 1.0.3 1.0.5 1.0.6 1.1.1 1.1.3 1.1.4 1.2.0 1.2.2 1.2.3 1.2.4 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4
disable-admin-notices / includes / 3rd-party / class-clearfy-plugin.php
disable-admin-notices / includes / 3rd-party Last commit date
class-clearfy-plugin.php 3 years ago
class-clearfy-plugin.php
79 lines
1 <?php
2 /**
3 * Disable admin notices core class
4 *
5 * Github: https://github.com/alexkovalevv
6 *
7 * @author Alexander Kovalev <alex.kovalevv@gmail.com>
8 * @copyright (c) 2018 Webraftic Ltd
9 * @version 1.0
10 */
11
12 // Exit if accessed directly
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 class WDN_Plugin {
18
19 /**
20 * @var WCL_Plugin
21 */
22 private static $app;
23
24 /**
25 * Конструктор
26 * Вы
27 *
28 * @author Alexander Kovalev <alex.kovalevv@gmail.com>
29 * @throws \Exception
30 */
31 public function __construct() {
32 if ( ! class_exists( 'WCL_Plugin' ) ) {
33 throw new Exception( 'Plugin Clearfy is not installed!' );
34 }
35
36 self::$app = WCL_Plugin::app();
37
38 $this->globalScripts();
39
40 if ( is_admin() ) {
41 $this->adminScripts();
42 }
43 }
44
45 /**
46 * @return WCL_Plugin
47 */
48 public static function app() {
49 return self::$app;
50 }
51
52 /**
53 * Выполняет сценарии, которые должны быть запущены только в бекенде
54 *
55 * @author Alexander Kovalev <alex.kovalevv@gmail.com>
56 * @since 1.1.0
57 */
58 private function adminScripts() {
59 require( WDN_PLUGIN_DIR . '/admin/options.php' );
60
61 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
62 require( WDN_PLUGIN_DIR . '/admin/ajax/hide-notice.php' );
63 require( WDN_PLUGIN_DIR . '/admin/ajax/restore-notice.php' );
64 }
65
66 require( WDN_PLUGIN_DIR . '/admin/boot.php' );
67 }
68
69 /**
70 * Выполняет сценрии, которые должны быть запущены глобально
71 *
72 * @author Alexander Kovalev <alex.kovalevv@gmail.com>
73 * @since 1.1.0
74 */
75 private function globalScripts() {
76 require( WDN_PLUGIN_DIR . '/includes/classes/class-configurate-notices.php' );
77 new WDN_ConfigHideNotices( self::$app );
78 }
79 }