PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.0.4
Adminify – White Label, Admin Menu Editor, Login Customizer v3.0.4
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Admin / Options / Custom_CSS_JS_Admin_Area.php

Custom_CSS_JS_Admin_Area.php in Adminify – White Label, Admin Menu Editor, Login Customizer 3.0.4, at Inc/Admin/Options/Custom_CSS_JS_Admin_Area.php

100 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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_Admin_Area 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' => '<style>
23 /* Write Admin Area CSS code here */
24 </style>',
25 'custom_js' => '<script>
26 ;(function($) {
27 "use strict";
28 $(document).ready( function() {
29 // Write your Admin Area JS code here
30 });
31 })( jQuery );
32 </script>'
33 ];
34 }
35
36
37 /**
38 * Post Status Columns
39 */
40
41 public function custom_css_js_fields(&$fields)
42 {
43 $fields[] = array(
44 'type' => 'subheading',
45 'content' => Utils::adminfiy_help_urls(
46 __('Custom CSS/JS Settings', 'adminify'),
47 'https://wpadminify.com/kb/wp-adminify-options-panel/#custom-css-js',
48 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
49 'https://www.facebook.com/groups/jeweltheme',
50 'https://wpadminify.com/support/'
51 )
52 );
53
54 $fields[] = array(
55 'id' => 'custom_css',
56 'type' => 'code_editor',
57 'title' => __('Custom CSS (Admin Area)', 'adminify'),
58 'subtitle' => __('Place cusotm css inside <strong>&lt;style&gt;&lt;/style&gt;</strong> tag.', 'adminify'),
59 'desc' => __('Write your own <strong>Custom CSS</strong> for WordPress Admin.', 'adminify'),
60 'settings' => array(
61 'theme' => 'monokai',
62 'mode' => 'htmlmixed',
63 ),
64 'sanitize' => false,
65 'default' => $this->get_default_field('custom_css')
66 );
67
68 $fields[] = array(
69 'id' => 'custom_js',
70 'type' => 'code_editor',
71 'title' => __('Custom JavaScript (Admin Area)', 'adminify'),
72 'subtitle' => __('Place custom script inside <strong>&lt;script&gt;&lt;/script&gt;</strong> tag.', 'adminify'),
73 'desc' => 'Write your own <strong>Custom Script</strong> for WordPress Admin.',
74 'settings' => array(
75 'theme' => 'dracula',
76 'mode' => 'htmlmixed',
77 ),
78 'sanitize' => false,
79 'default' => $this->get_default_field('custom_js')
80 );
81 }
82
83 public function general_post_settings()
84 {
85 if (!class_exists('ADMINIFY')) {
86 return;
87 }
88
89 $fields = [];
90 $this->custom_css_js_fields($fields);
91
92 // Custom CSS Settings
93 \ADMINIFY::createSection($this->prefix, array(
94 'title' => __('Custom CSS/JS', 'adminify'),
95 'icon' => 'fas fa-code',
96 'fields' => $fields
97 ));
98 }
99 }
100