| @@ -32,23 +32,18 @@ | ||
| 32 | 32 | |
| 33 | 33 | public function menu_editor_enqueue_scripts() |
| 34 | 34 | { |
| 35 | 35 | global $pagenow; |
| 36 | - $screen = get_current_screen(); | |
| 37 | - if ($pagenow == 'wp-login.php' || $pagenow == 'wp-register.php' || $pagenow == 'customize.php') { | |
| 38 | - return; | |
| 39 | - } | |
| 40 | - | |
| 41 | - if ($screen->id === 'toplevel_page_wp-adminify-settings') { | |
| 36 | + if (('admin.php' === $pagenow) && ('adminify-menu-editor' === $_GET['page'])) { | |
| 42 | 37 | $this->import_css(); |
| 43 | 38 | |
| 44 | 39 | // Enqueue Styles |
| 45 | 40 | wp_enqueue_style('wp-adminify-icon-picker'); |
| 46 | - wp_enqueue_style('wp-adminify-select2'); | |
| 41 | + wp_enqueue_style('wp-adminify-tokenize2'); | |
| 47 | 42 | wp_enqueue_style('wp-adminify-menu-editor'); |
| 48 | 43 | |
| 49 | 44 | // Enqueue Scripts |
| 50 | - wp_enqueue_script('wp-adminify-select2'); | |
| 45 | + wp_enqueue_script('wp-adminify-tokenize2'); | |
| 51 | 46 | wp_enqueue_script('wp-adminify-icon-picker'); |
| 52 | 47 | wp_enqueue_script('wp-adminify-menu-editor'); |
| 53 | 48 | |
| 54 | 49 | wp_localize_script( |
| @@ -60,22 +55,29 @@ | ||
| 60 | 55 | ); |
| 61 | 56 | } |
| 62 | 57 | |
| 63 | 58 | wp_enqueue_style('dashicons'); |
| 59 | + wp_enqueue_style('wp-adminify-simple-line-icons'); | |
| 60 | + wp_enqueue_style('wp-adminify-icomoon'); | |
| 61 | + wp_enqueue_style('wp-adminify-themify-icons'); | |
| 64 | 62 | |
| 63 | + if (Utils::is_plugin_active('elementor/elementor.php')) { | |
| 64 | + wp_enqueue_style('elementor-icons'); | |
| 65 | + } | |
| 66 | + | |
| 65 | 67 | // Plugins Packaged Icons Library |
| 66 | 68 | $plugins_icons = []; |
| 67 | - // if (Utils::is_plugin_active('elementor/elementor.php')) { | |
| 68 | - // $plugins_icons[] = 'elementor-icons'; | |
| 69 | - // } | |
| 69 | + if (Utils::is_plugin_active('elementor/elementor.php')) { | |
| 70 | + $plugins_icons[] = 'elementor-icons'; | |
| 71 | + } | |
| 70 | 72 | |
| 71 | 73 | // De-register and Dequeue Scripts/Styles |
| 72 | - // if (!empty($this->options['adminify_assets'])) { | |
| 73 | - // foreach ($this->options['adminify_assets'] as $value) { | |
| 74 | - // wp_dequeue_style($value); | |
| 75 | - // wp_deregister_style($value); | |
| 76 | - // } | |
| 77 | - // } | |
| 74 | + if (!empty($this->options['adminify_assets'])) { | |
| 75 | + foreach ($this->options['adminify_assets'] as $value) { | |
| 76 | + wp_dequeue_style($value); | |
| 77 | + wp_deregister_style($value); | |
| 78 | + } | |
| 79 | + } | |
| 78 | 80 | |
| 79 | 81 | // Localize Scripts |
| 80 | 82 | $localize_menu_data = [ |
| 81 | 83 | 'resturl' => get_rest_url() . 'wpadminify/v2/', |
| @@ -221,35 +223,8 @@ | ||
| 221 | 223 | } |
| 222 | 224 | .jltma-disabled{ |
| 223 | 225 | pointer-events: none; |
| 224 | 226 | opacity : 0.4; |
| 225 | - } | |
| 226 | - .select2-option-disabled{ | |
| 227 | - opacity: 0.5; | |
| 228 | - cursor: not-allowed; | |
| 229 | - } | |
| 230 | - .select2-container--default .select2-results__option[aria-disabled=true]{ | |
| 231 | - background: none !important; | |
| 232 | - color: inherit; | |
| 233 | - opacity: 0.5!important; | |
| 234 | - } | |
| 235 | - .select2-search-hint{ | |
| 236 | - color: #999; | |
| 237 | - font-style: italic; | |
| 238 | - } | |
| 239 | - select[name="hidden_for"].select2-hidden-accessible{ | |
| 240 | - position: absolute !important; | |
| 241 | - width: 1px !important; | |
| 242 | - height: 1px !important; | |
| 243 | - padding: 0 !important; | |
| 244 | - margin: -1px !important; | |
| 245 | - overflow: hidden !important; | |
| 246 | - clip: rect(0,0,0,0) !important; | |
| 247 | - border: 0 !important; | |
| 248 | - } | |
| 249 | - .adminify_sub_menu_item .select2-container, | |
| 250 | - .adminify_menu_item .select2-container{ | |
| 251 | - width: 100% !important; | |
| 252 | 227 | }'; |
| 253 | 228 | |
| 254 | 229 | // Combine the values from above and minifiy them. |
| 255 | 230 | $menu_editor_custom_css = preg_replace('#/\*.*?\*/#s', '', $menu_editor_custom_css); |