| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Admin\Options; |
| 4 |
|
| 5 |
use WPAdminify\Inc\Admin\AdminSettingsModel; |
| 6 |
|
| 7 |
if (!defined('ABSPATH')) { |
| 8 |
die; |
| 9 |
} // Cannot access directly. |
| 10 |
|
| 11 |
class WidgetSettings extends AdminSettingsModel |
| 12 |
{ |
| 13 |
public $defaults = []; |
| 14 |
|
| 15 |
public function __construct() |
| 16 |
{ |
| 17 |
$this->widget_settings(); |
| 18 |
} |
| 19 |
|
| 20 |
protected function get_defaults() |
| 21 |
{ |
| 22 |
return $this->defaults; |
| 23 |
} |
| 24 |
|
| 25 |
public function widget_settings() |
| 26 |
{ |
| 27 |
if (!class_exists('ADMINIFY')) { |
| 28 |
return; |
| 29 |
} |
| 30 |
|
| 31 |
\ADMINIFY::createSection($this->prefix, array( |
| 32 |
'title' => __('Widget Settings', 'adminify'), |
| 33 |
'id' => 'widget_settings', |
| 34 |
'icon' => 'dashicons dashicons-admin-appearance', |
| 35 |
)); |
| 36 |
|
| 37 |
$this->defaults = array_merge($this->defaults, (new DashboardWidgets())->get_defaults()); |
| 38 |
$this->defaults = array_merge($this->defaults, (new Sidebar_Remove())->get_defaults()); |
| 39 |
} |
| 40 |
} |
| 41 |
|