PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 3.1.9
Adminify – White Label, Admin Menu Editor, Login Customizer v3.1.9
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.1.9, at Inc/Admin/Options/Custom_CSS_JS_Admin_Area.php

90 lines 2.3 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 $this->general_post_settings();
16 }
17
18 public function get_defaults() {
19 return [
20 'custom_css' => '',
21 'custom_js' => '',
22 ];
23 }
24
25
26 /**
27 * Post Status Columns
28 */
29
30 public function custom_css_js_fields( &$fields ) {
31 $fields[] = array(
32 'type' => 'subheading',
33 'content' => Utils::adminfiy_help_urls(
34 __( 'Custom CSS/JS Settings', 'adminify' ),
35 'https://wpadminify.com/kb/wp-adminify-options-panel/#custom-css-js',
36 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
37 'https://www.facebook.com/groups/jeweltheme',
38 'https://wpadminify.com/support/'
39 ),
40 );
41
42 $fields[] = array(
43 'id' => 'custom_css',
44 'type' => 'code_editor',
45 'title' => __( 'Custom CSS (Admin Area)', 'adminify' ),
46 'subtitle' => __( 'Write your own <strong>Custom CSS</strong> for WordPress Admin.', 'adminify' ),
47 'desc' => __( 'Don\'t place &lt;style&gt;&lt;/style&gt; tag inside editor.', 'adminify' ),
48 'settings' => array(
49 'theme' => 'monokai',
50 'mode' => 'css',
51 ),
52 'sanitize' => false,
53 'default' => $this->get_default_field( 'custom_css' ),
54 );
55
56 $fields[] = array(
57 'id' => 'custom_js',
58 'type' => 'code_editor',
59 'title' => __( 'Custom JavaScript (Admin Area)', 'adminify' ),
60 'subtitle' => __( 'Write your own <strong>Custom Script</strong> for WordPress Admin.', 'adminify' ),
61 'desc' => __( 'Don\'t place &lt;script&gt;&lt;/script&gt; tag inside editor.', 'adminify' ),
62 'settings' => array(
63 'theme' => 'dracula',
64 'mode' => 'javascript',
65 ),
66 'sanitize' => false,
67 'default' => $this->get_default_field( 'custom_js' ),
68 );
69 }
70
71 public function general_post_settings() {
72 if ( ! class_exists( 'ADMINIFY' ) ) {
73 return;
74 }
75
76 $fields = array();
77 $this->custom_css_js_fields( $fields );
78
79 // Custom CSS Settings
80 \ADMINIFY::createSection(
81 $this->prefix,
82 array(
83 'title' => __( 'Custom CSS/JS', 'adminify' ),
84 'icon' => 'fas fa-code',
85 'fields' => $fields,
86 )
87 );
88 }
89 }
90