array( 'label' => __( 'Welcome', 'astra' ), 'show' => ! is_network_admin(), ), ); self::$view_actions = apply_filters( 'astra_menu_options', $actions ); } return self::$view_actions; } /** * Save All admin settings here */ static public function save_settings() { // Only admins can save settings. if ( ! current_user_can( 'manage_options' ) ) { return; } // Let extensions hook into saving. do_action( 'astra_admin_settings_save' ); } /** * Enqueues the needed CSS/JS for Backend. * * @since 1.0 */ static public function admin_scripts() { // Styles. wp_enqueue_style( 'astra-admin', ASTRA_THEME_URI . 'inc/assets/css/astra-admin.css', array(), ASTRA_THEME_VERSION ); $color_palettes = json_encode( astra_color_pallets() ); wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $color_palettes . ';' ); } /** * Enqueues the needed CSS/JS for the builder's admin settings page. * * @since 1.0 */ static public function styles_scripts() { // Styles. wp_enqueue_style( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/css/astra-admin-menu-settings.css', array(), ASTRA_THEME_VERSION ); } /** * Init Nav Menu * * @param mixed $action Action name. * @since 1.0 */ static public function init_nav_menu( $action = '' ) { if ( '' !== $action ) { self::render_tab_menu( $action ); } } /** * Update Admin Title. * * @since 1.0.19 * * @param string $admin_title Admin Title. * @param string $title Title. * @return string */ static public function astra_admin_title( $admin_title, $title ) { $screen = get_current_screen(); if ( 'appearance_page_astra' == $screen->id ) { $view_actions = self::get_view_actions(); $current_slug = isset( $_GET['action'] ) ? esc_attr( $_GET['action'] ) : self::$current_slug; $active_tab = str_replace( '_', '-', $current_slug ); if ( 'general' != $active_tab && isset( $view_actions[ $active_tab ]['label'] ) ) { $admin_title = str_replace( $title, $view_actions[ $active_tab ]['label'], $admin_title ); } } return $admin_title; } /** * Render tab menu * * @param mixed $action Action name. * @since 1.0 */ static public function render_tab_menu( $action = '' ) { ?>