$item ) { if ( 'elementor' === $item ) { $elementor_menu_order[] = 'separator-elementor'; $elementor_menu_order[] = $item; $elementor_menu_order[] = Source_Local::ADMIN_MENU_SLUG; unset( $menu_order[ $elementor_separator ] ); unset( $menu_order[ $elementor_library ] ); } elseif ( ! in_array( $item, [ 'separator-elementor' ], true ) ) { $elementor_menu_order[] = $item; } } // Return order. return $elementor_menu_order; } /** * Register Elementor Pro sub-menu. * * Add new Elementor Pro sub-menu under the main Elementor menu. * * Fired by `admin_menu` action. * * @since 1.0.0 * @access public */ public function register_pro_menu() { add_submenu_page( self::PAGE_ID, esc_html__( 'Submissions', 'elementor' ), esc_html__( 'Submissions', 'elementor' ), 'manage_options', 'e-form-submissions', function() { $this->elementor_form_submissions(); } ); add_submenu_page( self::PAGE_ID, esc_html__( 'Custom Fonts', 'elementor' ), esc_html__( 'Custom Fonts', 'elementor' ), 'manage_options', 'elementor_custom_fonts', [ $this, 'elementor_custom_fonts' ] ); add_submenu_page( self::PAGE_ID, esc_html__( 'Custom Icons', 'elementor' ), esc_html__( 'Custom Icons', 'elementor' ), 'manage_options', 'elementor_custom_icons', [ $this, 'elementor_custom_icons' ] ); add_submenu_page( self::PAGE_ID, __( 'Custom Code', 'elementor' ), __( 'Custom Code', 'elementor' ), 'manage_options', 'elementor_custom_custom_code', function() { $this->elementor_custom_code(); } ); add_submenu_page( self::PAGE_ID, '', ' ' . esc_html__( 'Go Pro', 'elementor' ), 'manage_options', 'go_elementor_pro', [ $this, 'handle_external_redirects' ] ); add_submenu_page( Source_Local::ADMIN_MENU_SLUG, esc_html__( 'Popups', 'elementor' ), esc_html__( 'Popups', 'elementor' ), 'manage_options', 'popup_templates', [ $this, 'elementor_popups' ] ); } /** * Register Elementor knowledge base sub-menu. * * Add new Elementor knowledge base sub-menu under the main Elementor menu. * * Fired by `admin_menu` action. * * @since 2.0.3 * @access public */ public function register_knowledge_base_menu() { add_submenu_page( self::PAGE_ID, '', __( 'Getting Started', 'elementor' ), 'manage_options', 'elementor-getting-started', [ $this, 'elementor_getting_started' ] ); add_submenu_page( self::PAGE_ID, '', esc_html__( 'Get Help', 'elementor' ), 'manage_options', 'go_knowledge_base_site', [ $this, 'handle_external_redirects' ] ); } /** * Go Elementor Pro. * * Redirect the Elementor Pro page the clicking the Elementor Pro menu link. * * Fired by `admin_init` action. * * @since 2.0.3 * @access public */ public function handle_external_redirects() { if ( empty( $_GET['page'] ) ) { return; } if ( 'go_elementor_pro' === $_GET['page'] ) { wp_redirect( Utils::get_pro_link( 'https://elementor.com/pro/?utm_source=wp-menu&utm_campaign=gopro&utm_medium=wp-dash' ) ); die; } if ( 'go_knowledge_base_site' === $_GET['page'] ) { wp_redirect( 'https://go.elementor.com/docs-admin-menu/' ); die; } } /** * Display settings page. * * Output the content for the getting started page. * * @since 2.2.0 * @access public */ public function elementor_getting_started() { if ( User::is_current_user_can_edit_post_type( 'page' ) ) { $create_new_label = esc_html__( 'Create Your First Page', 'elementor' ); $create_new_cpt = 'page'; } elseif ( User::is_current_user_can_edit_post_type( 'post' ) ) { $create_new_label = esc_html__( 'Create Your First Post', 'elementor' ); $create_new_cpt = 'post'; } ?>
handle_external_redirects(); $this->maybe_remove_all_admin_notices(); } /** * Change "Settings" menu name. * * Update the name of the Settings admin menu from "Elementor" to "Settings". * * Fired by `admin_menu` action. * * @since 1.0.0 * @access public */ public function admin_menu_change_name() { Utils::change_submenu_first_item_label( 'elementor', esc_html__( 'Settings', 'elementor' ) ); } /** * Update CSS print method. * * Clear post CSS cache. * * Fired by `add_option_elementor_css_print_method` and * `update_option_elementor_css_print_method` actions. * * @since 1.7.5 * @access public * @deprecated 3.0.0 */ public function update_css_print_method() { Plugin::$instance->files_manager->clear_cache(); } /** * Create tabs. * * Return the settings page tabs, sections and fields. * * @since 1.5.0 * @access protected * * @return array An array with the settings page tabs, sections and fields. */ protected function create_tabs() { $validations_class_name = __NAMESPACE__ . '\Settings_Validations'; return [ self::TAB_GENERAL => [ 'label' => esc_html__( 'General', 'elementor' ), 'sections' => [ 'general' => [ 'fields' => [ self::UPDATE_TIME_FIELD => [ 'full_field_id' => self::UPDATE_TIME_FIELD, 'field_args' => [ 'type' => 'hidden', ], 'setting_args' => [ $validations_class_name, 'current_time' ], ], 'cpt_support' => [ 'label' => esc_html__( 'Post Types', 'elementor' ), 'field_args' => [ 'type' => 'checkbox_list_cpt', 'std' => [ 'page', 'post' ], 'exclude' => [ 'attachment', 'elementor_library' ], ], 'setting_args' => [ $validations_class_name, 'checkbox_list' ], ], 'disable_color_schemes' => [ 'label' => esc_html__( 'Disable Default Colors', 'elementor' ), 'field_args' => [ 'type' => 'checkbox', 'value' => 'yes', 'sub_desc' => esc_html__( 'Checking this box will disable Elementor\'s Default Colors, and make Elementor inherit the colors from your theme.', 'elementor' ), ], ], 'disable_typography_schemes' => [ 'label' => esc_html__( 'Disable Default Fonts', 'elementor' ), 'field_args' => [ 'type' => 'checkbox', 'value' => 'yes', 'sub_desc' => esc_html__( 'Checking this box will disable Elementor\'s Default Fonts, and make Elementor inherit the fonts from your theme.', 'elementor' ), ], ], ], ], 'usage' => [ 'label' => esc_html__( 'Improve Elementor', 'elementor' ), 'fields' => $this->get_usage_fields(), ], ], ], self::TAB_STYLE => [ 'label' => esc_html__( 'Style', 'elementor' ), 'sections' => [ 'style' => [ 'fields' => [ 'notice' => [ 'label' => esc_html__( 'Looking for the Style settings?', 'elementor' ), 'field_args' => [ 'type' => 'raw_html', 'html' => sprintf( /* translators: 1: Bold open tag, 2: Bold close tag */ esc_html__( 'The Style settings changed its location and can now be found within Elementor Editor\'s %1$sPanel > Hamburger Menu > Site Settings%2$s.', 'elementor' ), '', '' ) . '