'astra-theme-rating',
'type' => '',
/* translators: %1$s logo link, %2$s product rating link, %3$s dismissable notice transient time. */
'message' => sprintf( __( '
Hello! Seems like you have used Astra theme to build this website — Thanks a ton!
Could you please do us a BIG favor and give it a 5-star rating on WordPress? This would boost our motivation and help other users make a comfortable decision while choosing the Astra theme.
', 'astra' ), $image_path, 'https://wordpress.org/support/theme/astra/reviews/?filter=5#new-post', MONTH_IN_SECONDS ),
'repeat-notice-after' => MONTH_IN_SECONDS,
)
);
}
}
/**
* View actions
*/
static public function get_view_actions() {
if ( empty( self::$view_actions ) ) {
$actions = array(
'general' => 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' );
}
/**
* Load the scripts and styles in the customizer controls.
*
* @since 1.2.1
*/
static public function customizer_scripts() {
$color_palettes = json_encode( astra_color_palette() );
wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $color_palettes . ';' );
}
/**
* Enqueues the needed CSS/JS for Backend.
*
* @since 1.0
*/
static public function admin_scripts() {
// Styles.
if ( is_rtl() ) {
wp_enqueue_style( 'astra-admin-rtl', ASTRA_THEME_URI . 'inc/assets/css/astra-admin-rtl.css', array(), ASTRA_THEME_VERSION );
} else {
wp_enqueue_style( 'astra-admin', ASTRA_THEME_URI . 'inc/assets/css/astra-admin.css', array(), ASTRA_THEME_VERSION );
}
/* Directory and Extension */
$file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
$dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
$assets_js_uri = ASTRA_THEME_URI . 'assets/js/' . $dir_name . '/';
/**
* Filters the Admin JavaScript handles added
*
* @since v1.4.10
*
* @param array array of the javascript handles.
*/
$js_handle = apply_filters( 'astra_admin_script_handles', array( 'jquery', 'wp-color-picker' ) );
// Add customize-base handle only for the Customizer Preview Screen.
if ( true === is_customize_preview() ) {
$js_handle[] = 'customize-base';
}
wp_enqueue_script( 'astra-color-alpha', $assets_js_uri . 'wp-color-picker-alpha' . $file_prefix . '.js', $js_handle, ASTRA_THEME_VERSION, true );
}
/**
* Enqueues the needed CSS/JS for the builder's admin settings page.
*
* @since 1.0
*/
static public function styles_scripts() {
// Styles.
if ( is_rtl() ) {
wp_enqueue_style( 'astra-admin-settings-rtl', ASTRA_THEME_URI . 'inc/assets/css/astra-admin-menu-settings-rtl.css', array(), ASTRA_THEME_VERSION );
} else {
wp_enqueue_style( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/css/astra-admin-menu-settings.css', array(), ASTRA_THEME_VERSION );
}
// Script.
wp_enqueue_script( 'astra-admin-settings', ASTRA_THEME_URI . 'inc/assets/js/astra-admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), ASTRA_THEME_VERSION );
$localize = array(
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
'btnActivating' => __( 'Activating Importer Plugin ', 'astra' ) . '…',
'astraSitesLink' => admin_url( 'themes.php?page=astra-sites' ),
'astraSitesLinkTitle' => __( 'See Library »', 'astra' ),
);
wp_localize_script( 'astra-admin-settings', 'astra', apply_filters( 'astra_theme_js_localize', $localize ) );
}
/**
* 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;
}
/**
* Get and return page URL
*
* @param string $menu_slug Menu name.
* @since 1.0
* @return string page url
*/
static public function get_page_url( $menu_slug ) {
$parent_page = self::$default_menu_position;
if ( strpos( $parent_page, '?' ) !== false ) {
$query_var = '&page=' . self::$plugin_slug;
} else {
$query_var = '?page=' . self::$plugin_slug;
}
$parent_page_url = admin_url( $parent_page . $query_var );
$url = $parent_page_url . '&action=' . $menu_slug;
return esc_url( $url );
}
/**
* Add main menu
*
* @since 1.0
*/
static public function add_admin_menu() {
$parent_page = self::$default_menu_position;
$page_title = self::$menu_page_title;
$capability = 'manage_options';
$page_menu_slug = self::$plugin_slug;
$page_menu_func = __CLASS__ . '::menu_callback';
if ( apply_filters( 'astra_dashboard_admin_menu', true ) ) {
add_theme_page( $page_title, $page_title, $capability, $page_menu_slug, $page_menu_func );
} else {
do_action( 'asta_register_admin_menu', $parent_page, $page_title, $capability, $page_menu_slug, $page_menu_func );
}
}
/**
* Menu callback
*
* @since 1.0
*/
static public function menu_callback() {
$current_slug = isset( $_GET['action'] ) ? esc_attr( $_GET['action'] ) : self::$current_slug;
$active_tab = str_replace( '_', '-', $current_slug );
$current_slug = str_replace( '-', '_', $current_slug );
$ast_icon = apply_filters( 'astra_page_top_icon', true );
$ast_visit_site_url = apply_filters( 'astra_site_url', 'https://wpastra.com' );
$ast_wrapper_class = apply_filters( 'astra_welcome_wrapper_class', array( $current_slug ) );
?>
' . esc_html( $astra_starter_sites_doc_link_text ) . '' :
esc_html( $astra_starter_sites_doc_link_text )
);
?>
%5$s ',
esc_attr( $class ),
isset( $link ) ? 'href="' . esc_url( $link ) . '"' : '',
isset( $data_slug ) ? 'data-slug="' . esc_attr( $data_slug ) . '"' : '',
isset( $data_init ) ? 'data-init="' . esc_attr( $data_init ) . '"' : '',
esc_html( $button_text )
);
?>
' . esc_html( $astra_knowledge_base_doc_link_text ) . '' :
esc_html( $astra_knowledge_base_doc_link_text )
);
?>
' . esc_html( $astra_community_group_link_text ) . '' :
esc_html( $astra_community_group_link_text )
);
?>
' . esc_html( $astra_support_link_text ) . '' :
esc_html( $astra_support_link_text )
);
?>
array(
'title' => __( 'Upload Logo', 'astra' ),
'dashicon' => 'dashicons-format-image',
'quick_url' => admin_url( 'customize.php?autofocus[control]=custom_logo' ),
),
'colors' => array(
'title' => __( 'Set Colors', 'astra' ),
'dashicon' => 'dashicons-admin-customizer',
'quick_url' => admin_url( 'customize.php?autofocus[panel]=panel-colors-background' ),
),
'typography' => array(
'title' => __( 'Customize Fonts', 'astra' ),
'dashicon' => 'dashicons-editor-textcolor',
'quick_url' => admin_url( 'customize.php?autofocus[panel]=panel-typography' ),
),
'layout' => array(
'title' => __( 'Layout Options', 'astra' ),
'dashicon' => 'dashicons-layout',
'quick_url' => admin_url( 'customize.php?autofocus[panel]=panel-layout' ),
),
'header' => array(
'title' => __( 'Header Options', 'astra' ),
'dashicon' => 'dashicons-align-center',
'quick_url' => admin_url( 'customize.php?autofocus[section]=section-header' ),
),
'blog-layout' => array(
'title' => __( 'Blog Layouts', 'astra' ),
'dashicon' => 'dashicons-welcome-write-blog',
'quick_url' => admin_url( 'customize.php?autofocus[section]=section-blog-group' ),
),
'footer' => array(
'title' => __( 'Footer Settings', 'astra' ),
'dashicon' => 'dashicons-admin-generic',
'quick_url' => admin_url( 'customize.php?autofocus[section]=section-footer-group' ),
),
'sidebars' => array(
'title' => __( 'Sidebar Options', 'astra' ),
'dashicon' => 'dashicons-align-left',
'quick_url' => admin_url( 'customize.php?autofocus[section]=section-sidebars' ),
),
)
);
$extensions = apply_filters(
'astra_addon_list',
array(
'colors-and-background' => array(
'title' => __( 'Colors & Background', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/colors-background-module/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/colors-background-module/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'typography' => array(
'title' => __( 'Typography', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/typography-module/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/typography-module/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'spacing' => array(
'title' => __( 'Spacing', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/spacing-addon-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/spacing-addon-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'blog-pro' => array(
'title' => __( 'Blog Pro', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/blog-pro-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/blog-pro-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'mobile-header' => array(
'title' => __( 'Mobile Header', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/mobile-header-with-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/mobile-header-with-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'header-sections' => array(
'title' => __( 'Header Sections', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/header-sections-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/header-sections-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'nav-menu' => array(
'title' => __( 'Nav Menu', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/nav-menu-addon/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/how-to-white-label-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'transparent-header' => array(
'title' => __( 'Transparent Header', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/transparent-header-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/transparent-header-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'sticky-header' => array(
'title' => __( 'Sticky Header', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/sticky-header-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/sticky-header-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'advanced-headers' => array(
'title' => __( 'Page Headers', 'astra' ),
'description' => __( 'Make your header layouts look more appealing and sexy!', 'astra' ),
'manage_settings' => true,
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/page-headers-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/page-headers-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'advanced-hooks' => array(
'title' => __( 'Custom Layouts', 'astra' ),
// 'icon' => ASTRA_EXT_URI . 'assets/img/astra-advanced-hooks.png',
'description' => __( 'Add content conditionally in the various hook areas of the theme.', 'astra' ),
'manage_settings' => true,
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/custom-layouts-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/custom-layouts-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'site-layouts' => array(
'title' => __( 'Site Layouts', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/site-layout-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/site-layout-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'advanced-footer' => array(
'title' => __( 'Footer Widgets', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/footer-widgets-astra-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/footer-widgets-astra-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'scroll-to-top' => array(
'title' => __( 'Scroll To Top', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/scroll-to-top-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/scroll-to-top-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'woocommerce' => array(
'title' => __( 'WooCommerce', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/woocommerce-module-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/woocommerce-module-overview/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'learndash' => array(
'title' => __( 'LearnDash', 'astra' ),
'description' => __( 'Supercharge your LearnDash website with amazing design features.', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/learndash-integration-in-astra-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/learndash-integration-in-astra-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'lifterlms' => array(
'title' => __( 'LifterLMS', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/lifterlms-module-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/lifterlms-module-pro/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
'white-label' => array(
'title' => __( 'White Label', 'astra' ),
'class' => 'ast-addon',
'title_url' => astra_get_pro_url( 'https://wpastra.com/docs/how-to-white-label-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'links' => array(
array(
'link_class' => 'ast-learn-more',
'link_url' => astra_get_pro_url( 'https://wpastra.com/docs/how-to-white-label-astra/', 'astra-dashboard', 'learn-more', 'welcome-page' ),
'link_text' => __( 'Learn More »', 'astra' ),
'target_blank' => true,
),
),
),
)
);
?>