PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.3
Elementor Website Builder – more than just a page builder v3.0.3
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
← All changes | includes/settings/settings.php +349 -217 4.2.03.0.3 View file →
@@ -1,13 +1,9 @@
1 1 <?php
2 2 namespace Elementor;
3 3
4 -use Elementor\Core\Files\Fonts\Google_Font;
5 -use Elementor\Modules\Promotions\Module as Promotions_Module;
4 +use Elementor\Core\Upgrade\Manager as Upgrades_Manager;
6 5 use Elementor\TemplateLibrary\Source_Local;
7 -use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
8 -use Elementor\Includes\Settings\AdminMenuItems\Editor_One_Home_Menu;
9 -use Elementor\Includes\Settings\AdminMenuItems\Editor_One_Settings_Menu;
10 6
11 7 if ( ! defined( 'ABSPATH' ) ) {
12 8 exit; // Exit if accessed directly.
13 9 }
@@ -27,9 +23,9 @@
27 23 */
28 24 const PAGE_ID = 'elementor';
29 25
30 26 /**
31 - * Upgrade menu priority.
27 + * Go Pro menu priority.
32 28 */
33 29 const MENU_PRIORITY_GO_PRO = 502;
34 30
35 31 /**
@@ -42,8 +38,13 @@
42 38 */
43 39 const TAB_GENERAL = 'general';
44 40
45 41 /**
42 + * Settings page style tab slug.
43 + */
44 + const TAB_STYLE = 'style';
45 +
46 + /**
46 47 * Settings page integrations tab slug.
47 48 */
48 49 const TAB_INTEGRATIONS = 'integrations';
49 50
@@ -52,17 +53,8 @@
52 53 */
53 54 const TAB_ADVANCED = 'advanced';
54 55
55 56 /**
56 - * Settings page performance tab slug.
57 - */
58 - const TAB_PERFORMANCE = 'performance';
59 -
60 - const ADMIN_MENU_PRIORITY = 10;
61 -
62 - const MENU_CAPABILITY_EDIT_POSTS = 'edit_posts';
63 -
64 - /**
65 57 * Register admin menu.
66 58 *
67 59 * Add new Elementor Settings admin menu.
68 60 *
@@ -71,36 +63,282 @@
71 63 * @since 1.0.0
72 64 * @access public
73 65 */
74 66 public function register_admin_menu() {
75 - if ( ! current_user_can( self::MENU_CAPABILITY_EDIT_POSTS ) ) {
67 + global $menu;
68 +
69 + $menu[] = [ '', 'read', 'separator-elementor', '', 'wp-menu-separator elementor' ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
70 +
71 + if ( ! current_user_can( 'manage_options' ) ) {
76 72 return;
77 73 }
78 74
79 75 add_menu_page(
80 - esc_html__( 'Elementor', 'elementor' ),
81 - esc_html__( 'Elementor', 'elementor' ),
82 - self::MENU_CAPABILITY_EDIT_POSTS,
76 + __( 'Elementor', 'elementor' ),
77 + __( 'Elementor', 'elementor' ),
78 + 'manage_options',
83 79 self::PAGE_ID,
84 - [ $this, 'display_home_screen' ],
80 + [ $this, 'display_settings_page' ],
85 81 '',
86 82 '58.5'
87 83 );
88 84 }
89 85
90 - public function display_home_screen() {
91 - echo '<div id="e-home-screen"></div>';
86 + /**
87 + * Reorder the Elementor menu items in admin.
88 + * Based on WC.
89 + *
90 + * @since 2.4.0
91 + *
92 + * @param array $menu_order Menu order.
93 + * @return array
94 + */
95 + public function menu_order( $menu_order ) {
96 + // Initialize our custom order array.
97 + $elementor_menu_order = [];
98 +
99 + // Get the index of our custom separator.
100 + $elementor_separator = array_search( 'separator-elementor', $menu_order, true );
101 +
102 + // Get index of library menu.
103 + $elementor_library = array_search( Source_Local::ADMIN_MENU_SLUG, $menu_order, true );
104 +
105 + // Loop through menu order and do some rearranging.
106 + foreach ( $menu_order as $index => $item ) {
107 + if ( 'elementor' === $item ) {
108 + $elementor_menu_order[] = 'separator-elementor';
109 + $elementor_menu_order[] = $item;
110 + $elementor_menu_order[] = Source_Local::ADMIN_MENU_SLUG;
111 +
112 + unset( $menu_order[ $elementor_separator ] );
113 + unset( $menu_order[ $elementor_library ] );
114 + } elseif ( ! in_array( $item, [ 'separator-elementor' ], true ) ) {
115 + $elementor_menu_order[] = $item;
116 + }
117 + }
118 +
119 + // Return order.
120 + return $elementor_menu_order;
92 121 }
93 122
94 - private function register_editor_one_settings_menu( Menu_Data_Provider $menu_data_provider ) {
95 - $menu_data_provider->register_menu( new Editor_One_Settings_Menu() );
123 + /**
124 + * Register Elementor Pro sub-menu.
125 + *
126 + * Add new Elementor Pro sub-menu under the main Elementor menu.
127 + *
128 + * Fired by `admin_menu` action.
129 + *
130 + * @since 1.0.0
131 + * @access public
132 + */
133 + public function register_pro_menu() {
134 + add_submenu_page(
135 + self::PAGE_ID,
136 + __( 'Custom Fonts', 'elementor' ),
137 + __( 'Custom Fonts', 'elementor' ),
138 + 'manage_options',
139 + 'elementor_custom_fonts',
140 + [ $this, 'elementor_custom_fonts' ]
141 + );
142 +
143 + add_submenu_page(
144 + self::PAGE_ID,
145 + __( 'Custom Icons', 'elementor' ),
146 + __( 'Custom Icons', 'elementor' ),
147 + 'manage_options',
148 + 'elementor_custom_icons',
149 + [ $this, 'elementor_custom_icons' ]
150 + );
151 +
152 + add_submenu_page(
153 + self::PAGE_ID,
154 + '',
155 + '<span class="dashicons dashicons-star-filled" style="font-size: 17px"></span> ' . __( 'Go Pro', 'elementor' ),
156 + 'manage_options',
157 + 'go_elementor_pro',
158 + [ $this, 'handle_external_redirects' ]
159 + );
160 +
161 + add_submenu_page( Source_Local::ADMIN_MENU_SLUG, __( 'Popups', 'elementor' ), __( 'Popups', 'elementor' ), 'manage_options', 'popup_templates', [ $this, 'elementor_popups' ] );
96 162 }
97 163
98 - private function register_editor_one_home_menu( Menu_Data_Provider $menu_data_provider ) {
99 - $menu_data_provider->register_menu( new Editor_One_Home_Menu() );
164 + /**
165 + * Register Elementor knowledge base sub-menu.
166 + *
167 + * Add new Elementor knowledge base sub-menu under the main Elementor menu.
168 + *
169 + * Fired by `admin_menu` action.
170 + *
171 + * @since 2.0.3
172 + * @access public
173 + */
174 + public function register_knowledge_base_menu() {
175 + add_submenu_page(
176 + self::PAGE_ID,
177 + '',
178 + __( 'Getting Started', 'elementor' ),
179 + 'manage_options',
180 + 'elementor-getting-started',
181 + [ $this, 'elementor_getting_started' ]
182 + );
183 +
184 + add_submenu_page(
185 + self::PAGE_ID,
186 + '',
187 + __( 'Get Help', 'elementor' ),
188 + 'manage_options',
189 + 'go_knowledge_base_site',
190 + [ $this, 'handle_external_redirects' ]
191 + );
100 192 }
101 193
102 194 /**
195 + * Go Elementor Pro.
196 + *
197 + * Redirect the Elementor Pro page the clicking the Elementor Pro menu link.
198 + *
199 + * Fired by `admin_init` action.
200 + *
201 + * @since 2.0.3
202 + * @access public
203 + */
204 + public function handle_external_redirects() {
205 + if ( empty( $_GET['page'] ) ) {
206 + return;
207 + }
208 +
209 + if ( 'go_elementor_pro' === $_GET['page'] ) {
210 + wp_redirect( Utils::get_pro_link( 'https://elementor.com/pro/?utm_source=wp-menu&utm_campaign=gopro&utm_medium=wp-dash' ) );
211 + die;
212 + }
213 +
214 + if ( 'go_knowledge_base_site' === $_GET['page'] ) {
215 + wp_redirect( 'https://go.elementor.com/docs-admin-menu/' );
216 + die;
217 + }
218 + }
219 +
220 + /**
221 + * Display settings page.
222 + *
223 + * Output the content for the getting started page.
224 + *
225 + * @since 2.2.0
226 + * @access public
227 + */
228 + public function elementor_getting_started() {
229 + if ( User::is_current_user_can_edit_post_type( 'page' ) ) {
230 + $create_new_label = __( 'Create Your First Page', 'elementor' );
231 + $create_new_cpt = 'page';
232 + } elseif ( User::is_current_user_can_edit_post_type( 'post' ) ) {
233 + $create_new_label = __( 'Create Your First Post', 'elementor' );
234 + $create_new_cpt = 'post';
235 + }
236 +
237 + ?>
238 + <div class="wrap">
239 + <div class="e-getting-started">
240 + <div class="e-getting-started__box postbox">
241 + <div class="e-getting-started__header">
242 + <div class="e-getting-started__title">
243 + <div class="e-logo-wrapper">
244 + <i class="eicon-elementor"></i>
245 + </div>
246 + <?php echo __( 'Getting Started', 'elementor' ); ?>
247 + </div>
248 + <a class="e-getting-started__skip" href="<?php echo esc_url( admin_url() ); ?>">
249 + <i class="eicon-close" aria-hidden="true" title="<?php esc_attr_e( 'Skip', 'elementor' ); ?>"></i>
250 + <span class="elementor-screen-only"><?php echo __( 'Skip', 'elementor' ); ?></span>
251 + </a>
252 + </div>
253 + <div class="e-getting-started__content">
254 + <div class="e-getting-started__content--narrow">
255 + <h2><?php echo __( 'Welcome to Elementor', 'elementor' ); ?></h2>
256 + <p><?php echo __( 'Get introduced to Elementor by watching our "Getting Started" video series. It will guide you through the steps needed to create your website. Then click to create your first page.', 'elementor' ); ?></p>
257 + </div>
258 +
259 + <div class="e-getting-started__video">
260 + <iframe width="620" height="350" src="https://www.youtube-nocookie.com/embed/videoseries?list=PLZyp9H25CboH8b_wsNyOmstckiOE8aUBg&amp;controls=1&amp;modestbranding=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
261 + </div>
262 +
263 + <div class="e-getting-started__actions e-getting-started__content--narrow">
264 + <?php if ( ! empty( $create_new_cpt ) ) : ?>
265 + <a href="<?php echo esc_url( Utils::get_create_new_post_url( $create_new_cpt ) ); ?>" class="button button-primary button-hero"><?php echo esc_html( $create_new_label ); ?></a>
266 + <?php endif; ?>
267 +
268 + <a href="https://go.elementor.com/getting-started/" target="_blank" class="button button-secondary button-hero"><?php echo __( 'Watch the Full Guide', 'elementor' ); ?></a>
269 + </div>
270 + </div>
271 + </div>
272 + </div>
273 + </div><!-- /.wrap -->
274 + <?php
275 + }
276 +
277 + /**
278 + * Display settings page.
279 + *
280 + * Output the content for the custom fonts page.
281 + *
282 + * @since 2.0.0
283 + * @access public
284 + */
285 + public function elementor_custom_fonts() {
286 + ?>
287 + <div class="wrap">
288 + <div class="elementor-blank_state">
289 + <img src="<?php echo ELEMENTOR_ASSETS_URL . 'images/go-pro-wp-dashboard.svg'; ?>" />
290 + <h2><?php echo __( 'Add Your Custom Fonts', 'elementor' ); ?></h2>
291 + <p><?php echo __( 'Custom Fonts allows you to add your self-hosted fonts and use them on your Elementor projects to create a unique brand language.', 'elementor' ); ?></p>
292 + <a class="elementor-button elementor-button-default elementor-button-go-pro" target="_blank" href="<?php echo Utils::get_pro_link( 'https://elementor.com/pro/?utm_source=wp-custom-fonts&utm_campaign=gopro&utm_medium=wp-dash' ); ?>"><?php echo __( 'Go Pro', 'elementor' ); ?></a>
293 + </div>
294 + </div><!-- /.wrap -->
295 + <?php
296 + }
297 +
298 + /**
299 + * Display settings page.
300 + *
301 + * Output the content for the custom icons page.
302 + *
303 + * @since 2.8.0
304 + * @access public
305 + */
306 + public function elementor_custom_icons() {
307 + ?>
308 + <div class="wrap">
309 + <div class="elementor-blank_state">
310 + <img src="<?php echo ELEMENTOR_ASSETS_URL . 'images/go-pro-wp-dashboard.svg'; ?>" />
311 + <h2><?php echo __( 'Add Your Custom Icons', 'elementor' ); ?></h2>
312 + <p><?php echo __( 'Don\'t rely solely on the FontAwesome icons everyone else is using! Differentiate your website and your style with custom icons you can upload from your favorite icons source.', 'elementor' ); ?></p>
313 + <a class="elementor-button elementor-button-default elementor-button-go-pro" target="_blank" href="<?php echo Utils::get_pro_link( 'https://elementor.com/pro/?utm_source=wp-custom-icons&utm_campaign=gopro&utm_medium=wp-dash' ); ?>"><?php echo __( 'Go Pro', 'elementor' ); ?></a>
314 + </div>
315 + </div><!-- /.wrap -->
316 + <?php
317 + }
318 +
319 + /**
320 + * Display settings page.
321 + *
322 + * Output the content for the Popups page.
323 + *
324 + * @since 2.4.0
325 + * @access public
326 + */
327 + public function elementor_popups() {
328 + ?>
329 + <div class="wrap">
330 + <div class="elementor-blank_state">
331 + <i class="eicon-nerd-chuckle"></i>
332 + <h2><?php echo __( 'Get Popup Builder', 'elementor' ); ?></h2>
333 + <p><?php echo __( 'Popup Builder lets you take advantage of all the amazing features in Elementor, so you can build beautiful & highly converting popups. Go pro and start designing your popups today.', 'elementor' ); ?></p>
334 + <a class="elementor-button elementor-button-default elementor-button-go-pro" target="_blank" href="<?php echo Utils::get_pro_link( 'https://elementor.com/popup-builder/?utm_source=popup-templates&utm_campaign=gopro&utm_medium=wp-dash' ); ?>"><?php echo __( 'Go Pro', 'elementor' ); ?></a>
335 + </div>
336 + </div><!-- /.wrap -->
337 + <?php
338 + }
339 +
340 + /**
103 341 * On admin init.
104 342 *
105 343 * Preform actions on WordPress admin initialization.
106 344 *
@@ -109,12 +347,34 @@
109 347 * @since 2.0.0
110 348 * @access public
111 349 */
112 350 public function on_admin_init() {
351 + $this->handle_external_redirects();
352 +
113 353 $this->maybe_remove_all_admin_notices();
114 354 }
115 355
116 356 /**
357 + * Change "Settings" menu name.
358 + *
359 + * Update the name of the Settings admin menu from "Elementor" to "Settings".
360 + *
361 + * Fired by `admin_menu` action.
362 + *
363 + * @since 1.0.0
364 + * @access public
365 + */
366 + public function admin_menu_change_name() {
367 + global $submenu;
368 +
369 + if ( isset( $submenu['elementor'] ) ) {
370 + // @codingStandardsIgnoreStart
371 + $submenu['elementor'][0][0] = __( 'Settings', 'elementor' );
372 + // @codingStandardsIgnoreEnd
373 + }
374 + }
375 +
376 + /**
117 377 * Update CSS print method.
118 378 *
119 379 * Clear post CSS cache.
120 380 *
@@ -122,9 +382,9 @@
122 382 * `update_option_elementor_css_print_method` actions.
123 383 *
124 384 * @since 1.7.5
125 385 * @access public
126 - * @deprecated 3.0.0 Use `Plugin::$instance->files_manager->clear_cache()` method instead.
386 + * @deprecated 3.0.0
127 387 */
128 388 public function update_css_print_method() {
129 389 Plugin::$instance->files_manager->clear_cache();
130 390 }
@@ -143,18 +403,11 @@
143 403 $validations_class_name = __NAMESPACE__ . '\Settings_Validations';
144 404
145 405 return [
146 406 self::TAB_GENERAL => [
147 - 'label' => esc_html__( 'General', 'elementor' ),
407 + 'label' => __( 'General', 'elementor' ),
148 408 'sections' => [
149 409 'general' => [
150 - 'label' => esc_html__( 'General', 'elementor' ),
151 - 'callback' => function() {
152 - printf(
153 - '<p>%s</p><br><hr><br>',
154 - esc_html__( 'Tailor how Elementor enhances your site, from post types to other functions.', 'elementor' )
155 - );
156 - },
157 410 'fields' => [
158 411 self::UPDATE_TIME_FIELD => [
159 412 'full_field_id' => self::UPDATE_TIME_FIELD,
160 413 'field_args' => [
@@ -162,9 +415,9 @@
162 415 ],
163 416 'setting_args' => [ $validations_class_name, 'current_time' ],
164 417 ],
165 418 'cpt_support' => [
166 - 'label' => esc_html__( 'Post Types', 'elementor' ),
419 + 'label' => __( 'Post Types', 'elementor' ),
167 420 'field_args' => [
168 421 'type' => 'checkbox_list_cpt',
169 422 'std' => [ 'page', 'post' ],
170 423 'exclude' => [ 'attachment', 'elementor_library' ],
@@ -171,210 +424,115 @@
171 424 ],
172 425 'setting_args' => [ $validations_class_name, 'checkbox_list' ],
173 426 ],
174 427 'disable_color_schemes' => [
175 - 'label' => esc_html__( 'Disable Default Colors', 'elementor' ),
428 + 'label' => __( 'Disable Default Colors', 'elementor' ),
176 429 'field_args' => [
177 430 'type' => 'checkbox',
178 431 'value' => 'yes',
179 - 'sub_desc' => esc_html__( 'Checking this box will disable Elementor\'s Default Colors, and make Elementor inherit the colors from your theme.', 'elementor' ),
432 + 'sub_desc' => __( 'Checking this box will disable Elementor\'s Default Colors, and make Elementor inherit the colors from your theme.', 'elementor' ),
180 433 ],
181 434 ],
182 435 'disable_typography_schemes' => [
183 - 'label' => esc_html__( 'Disable Default Fonts', 'elementor' ),
436 + 'label' => __( 'Disable Default Fonts', 'elementor' ),
184 437 'field_args' => [
185 438 'type' => 'checkbox',
186 439 'value' => 'yes',
187 - 'sub_desc' => esc_html__( 'Checking this box will disable Elementor\'s Default Fonts, and make Elementor inherit the fonts from your theme.', 'elementor' ),
440 + 'sub_desc' => __( 'Checking this box will disable Elementor\'s Default Fonts, and make Elementor inherit the fonts from your theme.', 'elementor' ),
188 441 ],
189 442 ],
190 443 ],
191 444 ],
192 445 'usage' => [
193 - 'label' => esc_html__( 'Improve Elementor', 'elementor' ),
194 - 'fields' => $this->get_usage_fields(),
195 - ],
196 - ],
197 - ],
198 - self::TAB_INTEGRATIONS => [
199 - 'label' => esc_html__( 'Integrations', 'elementor' ),
200 - 'sections' => [
201 - 'google_maps' => [
202 - 'label' => esc_html__( 'Google Maps Embed API', 'elementor' ),
203 - 'callback' => function() {
204 - printf(
205 - /* translators: 1: Link open tag, 2: Link close tag */
206 - esc_html__( 'Google Maps Embed API is a free service by Google that allows embedding Google Maps in your site. For more details, visit Google Maps\' %1$sUsing API Keys%2$s page.', 'elementor' ),
207 - '<a target="_blank" href="https://developers.google.com/maps/documentation/embed/get-api-key">',
208 - '</a>'
209 - );
210 - },
446 + 'label' => __( 'Improve Elementor', 'elementor' ),
211 447 'fields' => [
212 - 'google_maps_api_key' => [
213 - 'label' => esc_html__( 'API Key', 'elementor' ),
448 + 'allow_tracking' => [
449 + 'label' => __( 'Usage Data Sharing', 'elementor' ),
214 450 'field_args' => [
215 - 'class' => 'elementor_google_maps_api_key',
216 - 'type' => 'text',
451 + 'type' => 'checkbox',
452 + 'value' => 'yes',
453 + 'default' => '',
454 + 'sub_desc' => __( 'Become a super contributor by opting in to share non-sensitive plugin data and to receive periodic email updates from us.', 'elementor' ) . sprintf( ' <a href="%1$s" target="_blank">%2$s</a>', 'https://go.elementor.com/usage-data-tracking/', __( 'Learn more.', 'elementor' ) ),
217 455 ],
456 + 'setting_args' => [ __NAMESPACE__ . '\Tracker', 'check_for_settings_optin' ],
218 457 ],
219 458 ],
220 459 ],
221 460 ],
222 461 ],
223 - self::TAB_ADVANCED => [
224 - 'label' => esc_html__( 'Advanced', 'elementor' ),
462 + self::TAB_STYLE => [
463 + 'label' => __( 'Style', 'elementor' ),
225 464 'sections' => [
226 - 'advanced' => [
227 - 'label' => esc_html__( 'Advanced', 'elementor' ),
228 - 'callback' => function() {
229 - printf(
230 - '<p>%s</p><br><hr><br>',
231 - esc_html__( 'Personalize the way Elementor works on your website by choosing the advanced features and how they operate.', 'elementor' )
232 - );
233 - },
465 + 'style' => [
234 466 'fields' => [
235 - 'editor_break_lines' => [
236 - 'label' => esc_html__( 'Switch Editor Loader Method', 'elementor' ),
467 + 'notice' => [
468 + 'label' => __( 'Looking for the Style settings?', 'elementor' ),
237 469 'field_args' => [
238 - 'type' => 'select',
239 - 'std' => '',
240 - 'options' => [
241 - '' => esc_html__( 'Disable', 'elementor' ),
242 - '1' => esc_html__( 'Enable', 'elementor' ),
243 - ],
244 - 'desc' => esc_html__( 'For troubleshooting server configuration conflicts.', 'elementor' ),
470 + 'type' => 'raw_html',
471 + 'html' => __( 'The Style settings changed its location and can now be found within Elementor Editor\'s <b>Settings Panel > Hamburger Menu > Global Settings</b>.<br>You can use the Global Manager to make changes and see them live!', 'elementor' ) . sprintf( ' <a target="_blank" href="http://go.elementor.com/panel-layout-settings">%s</a>', __( 'Learn More', 'elementor' ) ),
245 472 ],
246 473 ],
247 - 'unfiltered_files_upload' => [
248 - 'label' => esc_html__( 'Enable Unfiltered File Uploads', 'elementor' ),
249 - 'field_args' => [
250 - 'type' => 'select',
251 - 'std' => '',
252 - 'options' => [
253 - '' => esc_html__( 'Disable', 'elementor' ),
254 - '1' => esc_html__( 'Enable', 'elementor' ),
255 - ],
256 - 'desc' => esc_html__( 'Please note! Allowing uploads of any files (SVG & JSON included) is a potential security risk.', 'elementor' ) . '<br>' . esc_html__( 'Elementor will try to sanitize the unfiltered files, removing potential malicious code and scripts.', 'elementor' ) . '<br>' . esc_html__( 'We recommend you only enable this feature if you understand the security risks involved.', 'elementor' ),
257 - ],
258 - ],
259 - 'google_font' => [
260 - 'label' => esc_html__( 'Google Fonts', 'elementor' ),
261 - 'field_args' => [
262 - 'type' => 'select',
263 - 'std' => '1',
264 - 'options' => [
265 - '1' => esc_html__( 'Enable', 'elementor' ),
266 - '0' => esc_html__( 'Disable', 'elementor' ),
267 - ],
268 - 'desc' => sprintf(
269 - /* translators: 1: Link opening tag, 2: Link closing tag */
270 - esc_html__( 'Disable this option if you want to prevent Google Fonts from being loaded. This setting is recommended when loading fonts from a different source (plugin, theme or %1$scustom fonts%2$s).', 'elementor' ),
271 - '<a href="' . admin_url( 'admin.php?page=elementor_custom_fonts' ) . '">',
272 - '</a>'
273 - ),
274 - ],
275 - ],
276 - 'font_display' => [
277 - 'label' => esc_html__( 'Google Fonts Load', 'elementor' ),
278 - 'field_args' => [
279 - 'type' => 'select',
280 - 'std' => 'auto',
281 - 'options' => [
282 - 'auto' => esc_html__( 'Default', 'elementor' ),
283 - 'block' => esc_html__( 'Blocking', 'elementor' ),
284 - 'swap' => esc_html__( 'Swap', 'elementor' ),
285 - 'fallback' => esc_html__( 'Fallback', 'elementor' ),
286 - 'optional' => esc_html__( 'Optional', 'elementor' ),
287 - ],
288 - 'desc' => esc_html__( 'Font-display property defines how font files are loaded and displayed by the browser.', 'elementor' ) . '<br>' . esc_html__( 'Set the way Google Fonts are being loaded by selecting the font-display property (Recommended: Swap).', 'elementor' ),
289 - ],
290 - ],
291 474 ],
292 475 ],
293 476 ],
294 477 ],
295 - self::TAB_PERFORMANCE => [
296 - 'label' => esc_html__( 'Performance', 'elementor' ),
478 + self::TAB_INTEGRATIONS => [
479 + 'label' => __( 'Integrations', 'elementor' ),
480 + 'sections' => [],
481 + ],
482 + self::TAB_ADVANCED => [
483 + 'label' => __( 'Advanced', 'elementor' ),
297 484 'sections' => [
298 - 'performance' => [
299 - 'label' => esc_html__( 'Performance', 'elementor' ),
300 - 'callback' => function() {
301 - printf(
302 - '<p>%s</p><br><hr><br>',
303 - esc_html__( 'Improve loading times on your site by selecting the optimization tools that best fit your requirements.', 'elementor' )
304 - );
305 - },
485 + 'advanced' => [
306 486 'fields' => [
307 487 'css_print_method' => [
308 - 'label' => esc_html__( 'CSS Print Method', 'elementor' ),
488 + 'label' => __( 'CSS Print Method', 'elementor' ),
309 489 'field_args' => [
310 490 'class' => 'elementor_css_print_method',
311 491 'type' => 'select',
312 - 'std' => 'external',
313 492 'options' => [
314 - 'external' => esc_html__( 'External File', 'elementor' ),
315 - 'internal' => esc_html__( 'Internal Embedding', 'elementor' ),
493 + 'external' => __( 'External File', 'elementor' ),
494 + 'internal' => __( 'Internal Embedding', 'elementor' ),
316 495 ],
317 - 'desc' => sprintf(
318 - /* translators: %s: <head> tag. */
319 - esc_html__( 'Internal Embedding places all CSS in the %s which works great for troubleshooting, while External File uses external CSS file for better performance (recommended).', 'elementor' ),
320 - '<code>&lt;head&gt;</code>',
321 - ),
496 + 'desc' => '<div class="elementor-css-print-method-description" data-value="external" style="display: none">' . __( 'Use external CSS files for all generated stylesheets. Choose this setting for better performance (recommended).', 'elementor' ) . '</div><div class="elementor-css-print-method-description" data-value="internal" style="display: none">' . __( 'Use internal CSS that is embedded in the head of the page. For troubleshooting server configuration conflicts and managing development environments.', 'elementor' ) . '</div>',
322 497 ],
323 498 ],
324 - 'optimized_image_loading' => [
325 - 'label' => esc_html__( 'Optimized Image Loading', 'elementor' ),
499 + 'editor_break_lines' => [
500 + 'label' => __( 'Switch Editor Loader Method', 'elementor' ),
326 501 'field_args' => [
327 502 'type' => 'select',
328 - 'std' => '1',
329 503 'options' => [
330 - '1' => esc_html__( 'Enable', 'elementor' ),
331 - '0' => esc_html__( 'Disable', 'elementor' ),
504 + '' => __( 'Disable', 'elementor' ),
505 + 1 => __( 'Enable', 'elementor' ),
332 506 ],
333 - 'desc' => sprintf(
334 - /* translators: 1: fetchpriority attribute, 2: lazy loading attribute. */
335 - esc_html__( 'Improve performance by applying %1$s on LCP image and %2$s on images below the fold.', 'elementor' ),
336 - '<code>fetchpriority="high"</code>',
337 - '<code>loading="lazy"</code>'
338 - ),
507 + 'desc' => __( 'For troubleshooting server configuration conflicts.', 'elementor' ),
339 508 ],
340 509 ],
341 - 'optimized_gutenberg_loading' => [
342 - 'label' => esc_html__( 'Optimized Gutenberg Loading', 'elementor' ),
510 + 'unfiltered_files_upload' => [
511 + 'label' => __( 'Enable Unfiltered File Uploads', 'elementor' ),
343 512 'field_args' => [
344 513 'type' => 'select',
345 - 'std' => '1',
514 + 'std' => '',
346 515 'options' => [
347 - '1' => esc_html__( 'Enable', 'elementor' ),
348 - '0' => esc_html__( 'Disable', 'elementor' ),
516 + '' => __( 'Disable', 'elementor' ),
517 + 1 => __( 'Enable', 'elementor' ),
349 518 ],
350 - 'desc' => esc_html__( 'Reduce unnecessary render-blocking loads by dequeuing unused Gutenberg block editor scripts and styles.', 'elementor' ),
519 + 'desc' => __( 'Please note! Allowing uploads of any files (SVG & JSON included) is a potential security risk.', 'elementor' ) . '<br>' . __( 'Elementor will try to sanitize the unfiltered files, removing potential malicious code and scripts.', 'elementor' ) . '<br>' . __( 'We recommend you only enable this feature if you understand the security risks involved.', 'elementor' ),
351 520 ],
352 521 ],
353 - 'lazy_load_background_images' => [
354 - 'label' => esc_html__( 'Lazy Load Background Images', 'elementor' ),
522 + 'optimized_dom_output' => [
523 + 'label' => __( 'Optimized DOM Output', 'elementor' ),
355 524 'field_args' => [
356 525 'type' => 'select',
357 - 'std' => '1',
358 526 'options' => [
359 - '1' => esc_html__( 'Enable', 'elementor' ),
360 - '0' => esc_html__( 'Disable', 'elementor' ),
527 + '' => __( 'Default', 'elementor' ),
528 + 'enabled' => __( 'Enable', 'elementor' ),
529 + 'disabled' => __( 'Disable', 'elementor' ),
361 530 ],
362 - 'desc' => esc_html__( 'Improve initial page load performance by lazy loading all background images except the first one.', 'elementor' ),
531 + 'desc' => __( 'Developers, Please Note! If you\'ve used custom code in Elementor, you might have experienced a snippet of code not running. Legacy DOM Output allows you to keep prior Elementor markup output settings, and have that lovely code running again.', 'elementor' )
532 + . '<a href="https://go.elementor.com/wp-dash-legacy-optimized-dom" target="_blank"> ' . __( 'Learn More', 'elementor' ) . '</a>',
363 533 ],
364 534 ],
365 - 'local_google_fonts' => [
366 - 'label' => esc_html__( 'Load Google Fonts Locally', 'elementor' ),
367 - 'field_args' => [
368 - 'type' => 'select',
369 - 'std' => '0',
370 - 'options' => [
371 - '1' => esc_html__( 'Enable', 'elementor' ),
372 - '0' => esc_html__( 'Disable', 'elementor' ),
373 - ],
374 - 'desc' => esc_html__( 'Load Google fonts locally to benefit from faster performance and ensure GDPR compliance. Fonts will be served from your own server instead of Google’s. Only the very first load (in the editor and on the front end) may take slightly longer.', 'elementor' ),
375 - ],
376 - ],
377 535 ],
378 536 ],
379 537 ],
380 538 ],
@@ -391,9 +549,9 @@
391 549 *
392 550 * @return string Settings page title.
393 551 */
394 552 protected function get_page_title() {
395 - return esc_html__( 'Elementor', 'elementor' );
553 + return __( 'Elementor', 'elementor' );
396 554 }
397 555
398 556 /**
399 557 * @since 2.2.0
@@ -400,16 +558,13 @@
400 558 * @access private
401 559 */
402 560 private function maybe_remove_all_admin_notices() {
403 561 $elementor_pages = [
404 - 'elementor-system-info',
405 - 'e-form-submissions',
562 + 'elementor-getting-started',
406 563 'elementor_custom_fonts',
407 564 'elementor_custom_icons',
408 565 'elementor-license',
409 - 'elementor_custom_code',
410 566 'popup_templates',
411 - 'elementor-apps',
412 567 ];
413 568
414 569 if ( empty( $_GET['page'] ) || ! in_array( $_GET['page'], $elementor_pages, true ) ) {
415 570 return;
@@ -417,21 +572,8 @@
417 572
418 573 remove_all_actions( 'admin_notices' );
419 574 }
420 575
421 - public function add_generator_tag_settings( $settings ) {
422 - $css_print_method = get_option( 'elementor_css_print_method', 'external' );
423 - $settings[] = 'css_print_method-' . $css_print_method;
424 -
425 - $google_font = Fonts::is_google_fonts_enabled() ? 'enabled' : 'disabled';
426 - $settings[] = 'google_font-' . $google_font;
427 -
428 - $font_display = Fonts::get_font_display_setting();
429 - $settings[] = 'font_display-' . $font_display;
430 -
431 - return $settings;
432 - }
433 -
434 576 /**
435 577 * Settings page constructor.
436 578 *
437 579 * Initializing Elementor "Settings" page.
@@ -442,31 +584,21 @@
442 584 public function __construct() {
443 585 parent::__construct();
444 586
445 587 add_action( 'admin_init', [ $this, 'on_admin_init' ] );
446 - add_filter( 'elementor/generator_tag/settings', [ $this, 'add_generator_tag_settings' ] );
447 -
448 588 add_action( 'admin_menu', [ $this, 'register_admin_menu' ], 20 );
589 + add_action( 'admin_menu', [ $this, 'admin_menu_change_name' ], 200 );
590 + add_action( 'admin_menu', [ $this, 'register_pro_menu' ], self::MENU_PRIORITY_GO_PRO );
591 + add_action( 'admin_menu', [ $this, 'register_knowledge_base_menu' ], 501 );
449 592
450 - add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
451 - $this->register_editor_one_settings_menu( $menu_data_provider );
452 - $this->register_editor_one_home_menu( $menu_data_provider );
453 - } );
454 -
455 593 $clear_cache_callback = [ Plugin::$instance->files_manager, 'clear_cache' ];
456 594
457 - // Clear CSS Meta after change css related methods.
458 - $css_settings = [
459 - 'elementor_disable_color_schemes',
460 - 'elementor_disable_typography_schemes',
461 - 'elementor_css_print_method',
462 - 'elementor_local_google_fonts',
463 - ];
595 + // Clear CSS Meta after change print method.
596 + add_action( 'add_option_elementor_css_print_method', $clear_cache_callback );
597 + add_action( 'update_option_elementor_css_print_method', $clear_cache_callback );
598 + add_action( 'add_option_elementor_optimized_dom_output', $clear_cache_callback );
599 + add_action( 'update_option_elementor_optimized_dom_output', $clear_cache_callback );
464 600
465 - foreach ( $css_settings as $option_name ) {
466 - add_action( "add_option_{$option_name}", $clear_cache_callback );
467 - add_action( "update_option_{$option_name}", $clear_cache_callback );
468 - }
469 -
470 - add_action( 'update_option_elementor_font_display', [ Google_Font::class, 'clear_cache' ] );
601 + add_filter( 'custom_menu_order', '__return_true' );
602 + add_filter( 'menu_order', [ $this, 'menu_order' ] );
471 603 }
472 604 }