href="https://developers.google.com/maps/documentation/embed/get-api-key">', '' ); }, 'fields' => [ 'google_maps_api_key' => [ 'label' => esc_html__( 'API Key', 'elementor' ), 'field_args' => [ 'class' => 'elementor_google_maps_api_key', 'type' => 'text', ], ], ], ], ], ], self::TAB_ADVANCED => [ 'label' => esc_html__( 'Advanced', 'elementor' ), 'sections' => [ 'advanced' => [ 'fields' => [ 'css_print_method' => [ 'label' => esc_html__( 'CSS Print Method', 'elementor' ), 'field_args' => [ 'class' => 'elementor_css_print_method', 'type' => 'select', 'std' => 'external', 'options' => [ 'external' => esc_html__( 'External File', 'elementor' ), 'internal' => esc_html__( 'Internal Embedding', 'elementor' ), ], 'desc' => '', ], ], 'editor_break_lines' => [ 'label' => esc_html__( 'Switch Editor Loader Method', 'elementor' ), 'field_args' => [ 'type' => 'select', 'std' => '', 'options' => [ '' => esc_html__( 'Disable', 'elementor' ), '1' => esc_html__( 'Enable', 'elementor' ), ], 'desc' => esc_html__( 'For troubleshooting server configuration conflicts.', 'elementor' ), ], ], 'unfiltered_files_upload' => [ 'label' => esc_html__( 'Enable Unfiltered File Uploads', 'elementor' ), 'field_args' => [ 'type' => 'select', 'std' => '', 'options' => [ '' => esc_html__( 'Disable', 'elementor' ), '1' => esc_html__( 'Enable', 'elementor' ), ], 'desc' => esc_html__( 'Please note! Allowing uploads of any files (SVG & JSON included) is a potential security risk.', 'elementor' ) . '
' . esc_html__( 'Elementor will try to sanitize the unfiltered files, removing potential malicious code and scripts.', 'elementor' ) . '
' . esc_html__( 'We recommend you only enable this feature if you understand the security risks involved.', 'elementor' ), ], ], 'google_font' => [ 'label' => esc_html__( 'Google Fonts', 'elementor' ), 'field_args' => [ 'type' => 'select', 'std' => '1', 'options' => [ '1' => esc_html__( 'Enable', 'elementor' ), '0' => esc_html__( 'Disable', 'elementor' ), ], 'desc' => sprintf( 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' ), '', '' ), ], ], 'font_display' => [ 'label' => esc_html__( 'Google Fonts Load', 'elementor' ), 'field_args' => [ 'type' => 'select', 'std' => 'auto', 'options' => [ 'auto' => esc_html__( 'Default', 'elementor' ), 'block' => esc_html__( 'Blocking', 'elementor' ), 'swap' => esc_html__( 'Swap', 'elementor' ), 'fallback' => esc_html__( 'Fallback', 'elementor' ), 'optional' => esc_html__( 'Optional', 'elementor' ), ], 'desc' => esc_html__( 'Font-display property defines how font files are loaded and displayed by the browser.', 'elementor' ) . '
' . esc_html__( 'Set the way Google Fonts are being loaded by selecting the font-display property (Default: Auto).', 'elementor' ), ], ], 'optimized_gutenberg_loading' => [ 'label' => esc_html__( 'Optimized Gutenberg Loading', 'elementor' ), 'field_args' => [ 'type' => 'select', 'std' => '1', 'options' => [ '1' => esc_html__( 'Enable', 'elementor' ), '0' => esc_html__( 'Disable', 'elementor' ), ], 'desc' => esc_html__( 'Use this experiment to reduce unnecessary render-blocking loads, enhancing site performance by dequeuing unused Gutenberg block editor files (styles and scripts).', 'elementor' ), ], ], 'optimized_image_loading' => [ 'label' => esc_html__( 'Optimized Image Loading', 'elementor' ), 'field_args' => [ 'type' => 'select', 'std' => '1', 'options' => [ '1' => esc_html__( 'Enable', 'elementor' ), '0' => esc_html__( 'Disable', 'elementor' ), ], 'desc' => sprintf( /* translators: 1: fetchpriority attribute, 2: lazy loading attribute. */ esc_html__( 'Applying %1$s on LCP image and %2$s on images below the fold to improve performance scores.', 'elementor' ), 'fetchpriority="high"', 'loading="lazy"' ), ], ], ], ], ], ], ]; } /** * Get settings page title. * * Retrieve the title for the settings page. * * @since 1.5.0 * @access protected * * @return string Settings page title. */ protected function get_page_title() { if ( Plugin::$instance->experiments->is_feature_active( 'admin_menu_rearrangement' ) ) { return esc_html__( 'Settings', 'elementor' ); } return esc_html__( 'Elementor', 'elementor' ); } /** * @since 2.2.0 * @access private */ private function maybe_remove_all_admin_notices() { $elementor_pages = [ 'elementor-getting-started', 'elementor-system-info', 'e-form-submissions', 'elementor_custom_fonts', 'elementor_custom_icons', 'elementor-license', 'elementor_custom_code', 'popup_templates', 'elementor-apps', ]; if ( empty( $_GET['page'] ) || ! in_array( $_GET['page'], $elementor_pages, true ) ) { return; } remove_all_actions( 'admin_notices' ); } public function add_generator_tag_settings( $settings ) { $css_print_method = get_option( 'elementor_css_print_method', 'external' ); $settings[] = 'css_print_method-' . $css_print_method; $google_font = Fonts::is_google_fonts_enabled() ? 'enabled' : 'disabled'; $settings[] = 'google_font-' . $google_font; $font_display = Fonts::get_font_display_setting(); $settings[] = 'font_display-' . $font_display; return $settings; } /** * Settings page constructor. * * Initializing Elementor "Settings" page. * * @since 1.0.0 * @access public */ public function __construct() { parent::__construct(); $this->home_module = new Home_Module(); add_action( 'admin_init', [ $this, 'on_admin_init' ] ); add_filter( 'elementor/generator_tag/settings', [ $this, 'add_generator_tag_settings' ] ); if ( ! Plugin::$instance->experiments->is_feature_active( 'admin_menu_rearrangement' ) ) { add_action( 'admin_menu', [ $this, 'register_admin_menu' ], 20 ); add_action( 'elementor/admin/menu/register', function ( Admin_Menu_Manager $admin_menu ) { $this->register_knowledge_base_menu( $admin_menu ); }, Promotions_Module::ADMIN_MENU_PRIORITY - 1 ); add_action( 'admin_menu', [ $this, 'admin_menu_change_name' ], 200 ); add_filter( 'custom_menu_order', '__return_true' ); add_filter( 'menu_order', [ $this, 'menu_order' ] ); } $clear_cache_callback = [ Plugin::$instance->files_manager, 'clear_cache' ]; // Clear CSS Meta after change css related methods. $css_settings = [ 'elementor_disable_color_schemes', 'elementor_disable_typography_schemes', 'elementor_css_print_method', ]; foreach ( $css_settings as $option_name ) { add_action( "add_option_{$option_name}", $clear_cache_callback ); add_action( "update_option_{$option_name}", $clear_cache_callback ); } } }