| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Modules\NotificationBar\Inc; |
| 4 |
|
| 5 |
use WPAdminify\Inc\Modules\NotificationBar\Inc\Settings\General; |
| 6 |
use WPAdminify\Inc\Modules\NotificationBar\Inc\Settings\Content; |
| 7 |
use WPAdminify\Inc\Modules\NotificationBar\Inc\Settings\Style; |
| 8 |
use WPAdminify\Inc\Modules\NotificationBar\Inc\Settings\Display; |
| 9 |
|
| 10 |
/** |
| 11 |
* WP Adminify |
| 12 |
* Module: Notification Bar Customization |
| 13 |
* |
| 14 |
* @author Jewel Theme <support@jeweltheme.com> |
| 15 |
*/ |
| 16 |
|
| 17 |
if (!class_exists('Notification_Customize')) { |
| 18 |
class Notification_Customize extends NotificationBarModel |
| 19 |
{ |
| 20 |
public $defaults = []; |
| 21 |
|
| 22 |
public function __construct() |
| 23 |
{ |
| 24 |
// this should be first so the default values get stored |
| 25 |
$this->notification_bar_options(); |
| 26 |
parent::__construct((array) get_option($this->prefix)); |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
protected function get_defaults() |
| 31 |
{ |
| 32 |
return $this->defaults; |
| 33 |
} |
| 34 |
|
| 35 |
public function notification_bar_options() |
| 36 |
{ |
| 37 |
if (!class_exists('ADMINIFY')) { |
| 38 |
return; |
| 39 |
} |
| 40 |
// Create customize options |
| 41 |
\ADMINIFY::createCustomizeOptions($this->prefix, array( |
| 42 |
'database' => 'option', |
| 43 |
'transport' => 'postMessage', |
| 44 |
'capability' => 'manage_options', |
| 45 |
'save_defaults' => true, |
| 46 |
'enqueue_webfont' => true, |
| 47 |
'async_webfont' => false, |
| 48 |
'output_css' => true, |
| 49 |
)); |
| 50 |
|
| 51 |
|
| 52 |
$this->defaults = array_merge($this->defaults, (new General())->get_defaults()); |
| 53 |
$this->defaults = array_merge($this->defaults, (new Content())->get_defaults()); |
| 54 |
$this->defaults = array_merge($this->defaults, (new Style())->get_defaults()); |
| 55 |
$this->defaults = array_merge($this->defaults, (new Display())->get_defaults()); |
| 56 |
} |
| 57 |
} |
| 58 |
} |
| 59 |
|