PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.1
Elementor Website Builder – more than just a page builder v3.34.1
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / editor-one / classes / menu-config.php

menu-config.php in Elementor Website Builder – more than just a page builder 3.34.1, at modules/editor-one/classes/menu-config.php

117 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\EditorOne\Classes;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 class Menu_Config {
10 const ELEMENTOR_MENU_SLUG = 'elementor';
11 const EDITOR_MENU_SLUG = 'elementor-editor';
12 const TEMPLATES_GROUP_ID = 'elementor-editor-templates';
13 const SETTINGS_GROUP_ID = 'elementor-editor-settings';
14 const EDITOR_GROUP_ID = 'elementor-editor-items';
15 const CUSTOM_ELEMENTS_GROUP_ID = 'elementor-editor-custom-elements';
16 const SYSTEM_GROUP_ID = 'elementor-editor-system';
17 const LEGACY_TEMPLATES_SLUG = 'edit.php?post_type=elementor_library';
18 public static function get_excluded_level4_slugs(): array {
19 // add new which is automatically added to templates and categories
20 $default_slugs = [
21 'edit-tags.php?taxonomy=elementor_library_category&amp;post_type=elementor_library',
22 ];
23
24 return apply_filters( 'elementor/editor-one/menu/excluded_level4_slugs', $default_slugs );
25 }
26 public static function get_excluded_level3_slugs(): array {
27 // elementor pro slugs
28 $default_slugs = [
29 'elementor-theme-builder',
30 'elementor-pro-notes-proxy',
31 self::EDITOR_MENU_SLUG,
32 ];
33
34 return apply_filters( 'elementor/editor-one/menu/excluded_level3_slugs', $default_slugs );
35 }
36
37 public static function get_legacy_slug_mapping(): array {
38 $default_mapping = [
39 self::LEGACY_TEMPLATES_SLUG => self::TEMPLATES_GROUP_ID,
40 self::ELEMENTOR_MENU_SLUG => self::EDITOR_GROUP_ID,
41 ];
42
43 return apply_filters( 'elementor/editor-one/menu/legacy_slug_mapping', $default_mapping );
44 }
45 public static function get_legacy_pro_mapping(): array {
46 $default_mapping = [
47 'elementor-license' => [ 'group' => self::SYSTEM_GROUP_ID ],
48 'edit.php?post_type=elementor_font' => [
49 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
50 'label' => __( 'Fonts', 'elementor' ),
51 ],
52 'edit.php?post_type=elementor_icons' => [
53 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
54 'label' => __( 'Icons', 'elementor' ),
55 ],
56 'edit.php?post_type=elementor_snippet' => [
57 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
58 'label' => __( 'Code', 'elementor' ),
59 ],
60 'e-custom-fonts' => [
61 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
62 'label' => __( 'Fonts', 'elementor' ),
63 ],
64 'e-custom-icons' => [
65 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
66 'label' => __( 'Icons', 'elementor' ),
67 ],
68 'e-custom-code' => [
69 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
70 'label' => __( 'Code', 'elementor' ),
71 ],
72 ];
73
74 return apply_filters( 'elementor/editor-one/menu/legacy_pro_mapping', $default_mapping );
75 }
76 public static function get_attribute_mapping(): array {
77 $default_mapping = [
78 'e-form-submissions' => [
79 'position' => 50,
80 'icon' => 'send',
81 ],
82 ];
83
84 return apply_filters( 'elementor/editor-one/menu/position_mapping', $default_mapping );
85 }
86 public static function get_custom_code_url(): string {
87 $pro_custom_code_cpt = 'elementor_snippet';
88
89 if ( post_type_exists( $pro_custom_code_cpt ) ) {
90 $default_url = admin_url( 'edit.php?post_type=' . $pro_custom_code_cpt );
91 } else {
92 $default_url = admin_url( 'admin.php?page=elementor_custom_code' );
93 }
94
95 return apply_filters( 'elementor/editor-one/menu/custom_code_url', $default_url );
96 }
97
98 public static function get_elementor_post_types(): array {
99 $default_values = [
100 'elementor_icons' => [
101 'menu_slug' => 'elementor-custom-elements',
102 'child_slug' => 'custom-icons',
103 ],
104 'elementor_font' => [
105 'menu_slug' => 'elementor-custom-elements',
106 'child_slug' => 'custom-fonts',
107 ],
108 'elementor_snippet' => [
109 'menu_slug' => 'elementor-custom-elements',
110 'child_slug' => 'custom-code',
111 ],
112 ];
113
114 return apply_filters( 'elementor/editor-one/menu/elementor_post_types', $default_values );
115 }
116 }
117