PluginProbe
Elementor Website Builder – more than just a page builder / 3.35.0
Elementor Website Builder – more than just a page builder v3.35.0
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.35.0, at modules/editor-one/classes/menu-config.php

134 lines 4.2 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 ELEMENTOR_HOME_MENU_SLUG = 'elementor-home';
12 const EDITOR_MENU_SLUG = 'elementor-editor';
13 const TEMPLATES_GROUP_ID = 'elementor-editor-templates';
14 const SETTINGS_GROUP_ID = 'elementor-editor-settings';
15 const EDITOR_GROUP_ID = 'elementor-editor-items';
16 const CUSTOM_ELEMENTS_GROUP_ID = 'elementor-editor-custom-elements';
17 const SYSTEM_GROUP_ID = 'elementor-editor-system';
18 const THIRD_PARTY_GROUP_ID = 'elementor-editor-third-party';
19 const LEGACY_TEMPLATES_SLUG = 'edit.php?post_type=elementor_library';
20 const CAPABILITY_EDIT_POSTS = 'edit_posts';
21 const CAPABILITY_MANAGE_OPTIONS = 'manage_options';
22 const MENU_POSITION = 58.5;
23 public static function get_excluded_level4_slugs(): array {
24 // add new which is automatically added to templates and categories
25 $default_slugs = [
26 'edit-tags.php?taxonomy=elementor_library_category&amp;post_type=elementor_library',
27 ];
28
29 return apply_filters( 'elementor/editor-one/menu/excluded_level4_slugs', $default_slugs );
30 }
31
32 public static function get_excluded_level3_slugs(): array {
33 // elementor pro slugs
34 $default_slugs = [
35 'elementor-theme-builder',
36 'elementor-pro-notes-proxy',
37 self::EDITOR_MENU_SLUG,
38 ];
39
40 return apply_filters( 'elementor/editor-one/menu/excluded_level3_slugs', $default_slugs );
41 }
42
43 public static function get_legacy_slug_mapping(): array {
44 $default_mapping = [
45 self::LEGACY_TEMPLATES_SLUG => self::TEMPLATES_GROUP_ID,
46 ];
47
48 return apply_filters( 'elementor/editor-one/menu/legacy_slug_mapping', $default_mapping );
49 }
50
51 public static function is_elementor_home_menu_available(): bool {
52 return class_exists( '\ElementorOne\Loader' );
53 }
54
55 public static function get_legacy_pro_mapping(): array {
56 $default_mapping = [
57 'elementor-license' => [ 'group' => self::SYSTEM_GROUP_ID ],
58 'e-form-submissions' => [ 'group' => self::EDITOR_GROUP_ID ],
59 'edit.php?post_type=elementor_font' => [
60 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
61 'label' => __( 'Fonts', 'elementor' ),
62 ],
63 'edit.php?post_type=elementor_icons' => [
64 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
65 'label' => __( 'Icons', 'elementor' ),
66 ],
67 'edit.php?post_type=elementor_snippet' => [
68 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
69 'label' => __( 'Code', 'elementor' ),
70 ],
71 'e-custom-fonts' => [
72 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
73 'label' => __( 'Fonts', 'elementor' ),
74 ],
75 'e-custom-icons' => [
76 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
77 'label' => __( 'Icons', 'elementor' ),
78 ],
79 'e-custom-code' => [
80 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
81 'label' => __( 'Code', 'elementor' ),
82 ],
83 ];
84
85 return apply_filters( 'elementor/editor-one/menu/legacy_pro_mapping', $default_mapping );
86 }
87
88 public static function get_attribute_mapping(): array {
89 $default_mapping = [
90 'e-form-submissions' => [
91 'position' => 50,
92 'icon' => 'send',
93 ],
94 ];
95
96 return apply_filters( 'elementor/editor-one/menu/position_mapping', $default_mapping );
97 }
98
99 public static function get_custom_code_url(): string {
100 $pro_custom_code_cpt = 'elementor_snippet';
101
102 if ( post_type_exists( $pro_custom_code_cpt ) ) {
103 $default_url = admin_url( 'edit.php?post_type=' . $pro_custom_code_cpt );
104 } else {
105 $default_url = admin_url( 'admin.php?page=elementor_custom_code' );
106 }
107
108 return apply_filters( 'elementor/editor-one/menu/custom_code_url', $default_url );
109 }
110
111 public static function get_elementor_home_url(): string {
112 return admin_url( 'admin.php?page=' . self::ELEMENTOR_MENU_SLUG );
113 }
114
115 public static function get_elementor_post_types(): array {
116 $default_values = [
117 'elementor_icons' => [
118 'menu_slug' => 'elementor-custom-elements',
119 'child_slug' => 'edit.php?post_type=elementor_icons',
120 ],
121 'elementor_font' => [
122 'menu_slug' => 'elementor-custom-elements',
123 'child_slug' => 'edit.php?post_type=elementor_font',
124 ],
125 'elementor_snippet' => [
126 'menu_slug' => 'elementor-custom-elements',
127 'child_slug' => 'edit.php?post_type=elementor_snippet',
128 ],
129 ];
130
131 return apply_filters( 'elementor/editor-one/menu/elementor_post_types', $default_values );
132 }
133 }
134