| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Admin\Options; |
| 4 |
|
| 5 |
use WPAdminify\Inc\Utils; |
| 6 |
use WPAdminify\Inc\Admin\AdminSettingsModel; |
| 7 |
|
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
die; |
| 11 |
} // Cannot access directly. |
| 12 |
|
| 13 |
if ( ! class_exists( 'Tweaks' ) ) { |
| 14 |
class Tweaks extends AdminSettingsModel { |
| 15 |
|
| 16 |
public $defaults = []; |
| 17 |
|
| 18 |
public function __construct() { |
| 19 |
$this->tweak_settings(); |
| 20 |
parent::__construct( (array) get_option( $this->prefix ) ); |
| 21 |
} |
| 22 |
|
| 23 |
protected function get_defaults() { |
| 24 |
return $this->defaults; |
| 25 |
} |
| 26 |
|
| 27 |
public function tweak_settings() { |
| 28 |
if ( ! class_exists( 'ADMINIFY' ) ) { |
| 29 |
return; |
| 30 |
} |
| 31 |
|
| 32 |
// Tweaks Section |
| 33 |
\ADMINIFY::createSection( |
| 34 |
$this->prefix, |
| 35 |
[ |
| 36 |
'title' => __( 'Tweaks', 'adminify' ), |
| 37 |
'id' => 'tweaks_performance', |
| 38 |
'icon' => 'fas fa-tools', |
| 39 |
] |
| 40 |
); |
| 41 |
|
| 42 |
$this->defaults = array_merge( $this->defaults, ( new Tweaks_Head() )->get_defaults() ); |
| 43 |
$this->defaults = array_merge( $this->defaults, ( new Tweaks_Feed() )->get_defaults() ); |
| 44 |
$this->defaults = array_merge( $this->defaults, ( new Tweaks_HTTP_Response() )->get_defaults() ); |
| 45 |
$this->defaults = array_merge( $this->defaults, ( new Tweaks_WP_JSON_API() )->get_defaults() ); |
| 46 |
$this->defaults = array_merge( $this->defaults, ( new Tweaks_Comments() )->get_defaults() ); |
| 47 |
$this->defaults = array_merge( $this->defaults, ( new Tweaks_Archives() )->get_defaults() ); |
| 48 |
$this->defaults = array_merge( $this->defaults, ( new Tweaks_Attachments() )->get_defaults() ); |
| 49 |
$this->defaults = array_merge( $this->defaults, ( new Tweaks_Performance() )->get_defaults() ); |
| 50 |
} |
| 51 |
} |
| 52 |
} |
| 53 |
|