PluginProbe
Disable Admin Notices – Hide Dashboard Notifications / 1.2.2
Disable Admin Notices – Hide Dashboard Notifications v1.2.2
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 All 30 releases
disable-admin-notices / includes / class-plugin.php
class-plugin.php
87 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Disable admin notices core class
4 *
5 * @author Alexander Kovalev <alex.kovalevv@gmail.com>
6 * Github: https://github.com/alexkovalevv
7 * @copyright (c) 2018 Webraftic Ltd
8 * @version 1.0
9 */
10
11 // Exit if accessed directly
12 //use WBCR\Factory_Adverts_111\Base;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 class WDN_Plugin extends Wbcr_Factory431_Plugin {
19
20 /**
21 * @var Wbcr_Factory431_Plugin
22 */
23 private static $app;
24 private $plugin_data;
25
26
27 /**
28 * @param string $plugin_path
29 * @param array $data
30 *
31 * @throws Exception
32 */
33 public function __construct( $plugin_path, $data ) {
34 parent::__construct( $plugin_path, $data );
35
36 self::$app = $this;
37 $this->plugin_data = $data;
38
39 $this->global_scripts();
40
41 if ( is_admin() ) {
42 $this->admin_scripts();
43 }
44 }
45
46 /**
47 * @return Wbcr_Factory431_Plugin
48 */
49 public static function app() {
50 return self::$app;
51 }
52
53 private function registerPages() {
54 self::app()->registerPage( 'WDN_Settings_Page', WDN_PLUGIN_DIR . '/admin/pages/class-pages-settings.php' );
55
56 if ( ! ( $this->premium->is_activate() && $this->premium->is_install_package() ) ) {
57 self::app()->registerPage( 'WDAN_Block_Ad_Redirects', WDN_PLUGIN_DIR . '/admin/pages/class-pages-edit-redirects.php' );
58 self::app()->registerPage( 'WDAN_Edit_Admin_Bar', WDN_PLUGIN_DIR . '/admin/pages/class-pages-edit-admin-bar.php' );
59 }
60
61 self::app()->registerPage( 'WDN_LicensePage', WDN_PLUGIN_DIR . '/admin/pages/class-pages-license.php' );
62 }
63
64 private function admin_scripts() {
65 require( WDN_PLUGIN_DIR . '/admin/options.php' );
66
67 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
68 require_once( WDN_PLUGIN_DIR . '/admin/ajax/hide-notice.php' );
69 require_once( WDN_PLUGIN_DIR . '/admin/ajax/restore-notice.php' );
70 }
71
72 require_once( WDN_PLUGIN_DIR . '/admin/boot.php' );
73 require_once( WDN_PLUGIN_DIR . '/admin/pages/class-pages-edit-admin-bar.php' );
74 require_once( WDN_PLUGIN_DIR . '/admin/pages/class-pages-edit-redirects.php' );
75
76 add_action( 'plugins_loaded', function () {
77 $this->registerPages();
78 }, 30 );
79 }
80
81 private function global_scripts() {
82 require_once( WDN_PLUGIN_DIR . '/includes/function.php' );
83 require_once( WDN_PLUGIN_DIR . '/includes/classes/class-configurate-notices.php' );
84 new WDN_ConfigHideNotices( self::$app );
85 }
86 }
87