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

130 lines 4.1 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 get_legacy_pro_mapping(): array {
52 $default_mapping = [
53 'elementor-license' => [ 'group' => self::SYSTEM_GROUP_ID ],
54 'e-form-submissions' => [ 'group' => self::EDITOR_GROUP_ID ],
55 'edit.php?post_type=elementor_font' => [
56 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
57 'label' => __( 'Fonts', 'elementor' ),
58 ],
59 'edit.php?post_type=elementor_icons' => [
60 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
61 'label' => __( 'Icons', 'elementor' ),
62 ],
63 'edit.php?post_type=elementor_snippet' => [
64 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
65 'label' => __( 'Code', 'elementor' ),
66 ],
67 'e-custom-fonts' => [
68 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
69 'label' => __( 'Fonts', 'elementor' ),
70 ],
71 'e-custom-icons' => [
72 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
73 'label' => __( 'Icons', 'elementor' ),
74 ],
75 'e-custom-code' => [
76 'group' => self::CUSTOM_ELEMENTS_GROUP_ID,
77 'label' => __( 'Code', 'elementor' ),
78 ],
79 ];
80
81 return apply_filters( 'elementor/editor-one/menu/legacy_pro_mapping', $default_mapping );
82 }
83
84 public static function get_attribute_mapping(): array {
85 $default_mapping = [
86 'e-form-submissions' => [
87 'position' => 50,
88 'icon' => 'send',
89 ],
90 ];
91
92 return apply_filters( 'elementor/editor-one/menu/position_mapping', $default_mapping );
93 }
94
95 public static function get_custom_code_url(): string {
96 $pro_custom_code_cpt = 'elementor_snippet';
97
98 if ( post_type_exists( $pro_custom_code_cpt ) ) {
99 $default_url = admin_url( 'edit.php?post_type=' . $pro_custom_code_cpt );
100 } else {
101 $default_url = admin_url( 'admin.php?page=elementor_custom_code' );
102 }
103
104 return apply_filters( 'elementor/editor-one/menu/custom_code_url', $default_url );
105 }
106
107 public static function get_elementor_home_url(): string {
108 return admin_url( 'admin.php?page=' . self::ELEMENTOR_MENU_SLUG );
109 }
110
111 public static function get_elementor_post_types(): array {
112 $default_values = [
113 'elementor_icons' => [
114 'menu_slug' => 'elementor-custom-elements',
115 'child_slug' => 'edit.php?post_type=elementor_icons',
116 ],
117 'elementor_font' => [
118 'menu_slug' => 'elementor-custom-elements',
119 'child_slug' => 'edit.php?post_type=elementor_font',
120 ],
121 'elementor_snippet' => [
122 'menu_slug' => 'elementor-custom-elements',
123 'child_slug' => 'edit.php?post_type=elementor_snippet',
124 ],
125 ];
126
127 return apply_filters( 'elementor/editor-one/menu/elementor_post_types', $default_values );
128 }
129 }
130