| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Admin\Options; |
| 4 |
|
| 5 |
use WPAdminify\Inc\Utils; |
| 6 |
use WPAdminify\Inc\Admin\AdminSettingsModel; |
| 7 |
|
| 8 |
if (!defined('ABSPATH')) { |
| 9 |
die; |
| 10 |
} // Cannot access directly. |
| 11 |
|
| 12 |
class Custom_CSS_JS_Backup extends AdminSettingsModel |
| 13 |
{ |
| 14 |
public function __construct() |
| 15 |
{ |
| 16 |
$this->general_post_settings(); |
| 17 |
} |
| 18 |
|
| 19 |
public function get_defaults() |
| 20 |
{ |
| 21 |
return [ |
| 22 |
'custom_css' => '', |
| 23 |
'custom_js' => '' |
| 24 |
]; |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
/** |
| 29 |
* Post Status Columns |
| 30 |
*/ |
| 31 |
|
| 32 |
public function custom_css_js_fields(&$fields) |
| 33 |
{ |
| 34 |
$fields[] = array( |
| 35 |
'type' => 'subheading', |
| 36 |
'content' => Utils::adminfiy_help_urls( |
| 37 |
__('Custom CSS/JS Settings', WP_ADMINIFY_TD), |
| 38 |
'https://wpadminify.com/kb/wp-adminify-options-panel/#custom-css-js', |
| 39 |
'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8', |
| 40 |
'https://www.facebook.com/groups/jeweltheme', |
| 41 |
'https://wpadminify.com/support/' |
| 42 |
) |
| 43 |
); |
| 44 |
|
| 45 |
$fields[] = array( |
| 46 |
'id' => 'custom_css', |
| 47 |
'type' => 'code_editor', |
| 48 |
'title' => __('Custom CSS', WP_ADMINIFY_TD), |
| 49 |
'desc' => __('Write your own <strong>Custom CSS</strong> for WordPress Admin here', WP_ADMINIFY_TD), |
| 50 |
'settings' => array( |
| 51 |
'theme' => 'mbo', |
| 52 |
'mode' => 'css', |
| 53 |
), |
| 54 |
'default' => ' |
| 55 |
/* Your Custom CSS Code here */' |
| 56 |
); |
| 57 |
|
| 58 |
$fields[] = array( |
| 59 |
'id' => 'custom_js', |
| 60 |
'type' => 'code_editor', |
| 61 |
'title' => __('Custom JavaScript', WP_ADMINIFY_TD), |
| 62 |
'desc' => 'Write your own <strong>Custom Script</strong> for WordPress Admin here', |
| 63 |
'settings' => array( |
| 64 |
'theme' => 'dracula', |
| 65 |
'mode' => 'javascript', |
| 66 |
) |
| 67 |
); |
| 68 |
} |
| 69 |
|
| 70 |
public function general_post_settings() |
| 71 |
{ |
| 72 |
if (!class_exists('ADMINIFY')) { |
| 73 |
return; |
| 74 |
} |
| 75 |
|
| 76 |
$fields = []; |
| 77 |
$this->custom_css_js_fields($fields); |
| 78 |
|
| 79 |
// Custom CSS Settings |
| 80 |
\ADMINIFY::createSection($this->prefix, array( |
| 81 |
'title' => __('Custom CSS/JS', WP_ADMINIFY_TD), |
| 82 |
'icon' => 'fas fa-code', |
| 83 |
'fields' => $fields |
| 84 |
)); |
| 85 |
} |
| 86 |
} |
| 87 |
|