theme_name = apply_filters( 'ti_wl_theme_name', $theme_args->__get( 'Name' ) ); $this->theme_slug = $theme_args->__get( 'stylesheet' ); /* * About page instance */ $config = array( 'footer_messages' => array( 'type' => 'custom', 'messages' => array( array( // translators: %s - theme name 'heading' => sprintf( __( '%s Community', 'hestia' ), $this->theme_name ), // translators: %s - theme name 'text' => sprintf( __( 'Join the community of %s users. Get connected, share opinions, ask questions and help each other!', 'hestia' ), $this->theme_name ), 'link_text' => __( 'Join our Facebook Group', 'hestia' ), 'link' => apply_filters( 'ti_wl_agency_url', 'https://www.facebook.com/groups/2024469201114053/' ), ), array( 'heading' => __( 'Leave us a review', 'hestia' ), // translators: %s - theme name 'text' => sprintf( __( 'Are you are enjoying %s? We would love to hear your feedback.', 'hestia' ), $this->theme_name ), 'link_text' => __( 'Submit a review', 'hestia' ), 'link' => apply_filters( 'ti_wl_agency_url', 'https://wordpress.org/support/theme/hestia/reviews/#new-post' ), ), ), ), 'getting_started' => array( 'type' => 'columns-3', 'title' => __( 'Getting Started', 'hestia' ), 'content' => array( array( 'title' => esc_html__( 'Recommended actions', 'hestia' ), 'text_old' => esc_html__( 'Hestia now comes with a sites library with various designs to pick from. Visit our collection of demos that are constantly being added.', 'hestia' ), 'text' => esc_html__( 'We have compiled a list of steps for you to take so we can ensure that the experience you have using one of our products is very easy to follow.', 'hestia' ), 'button' => array( 'label' => esc_html__( 'Recommended actions', 'hestia' ), 'link' => esc_url( '#recommended_actions' ), 'is_button' => true, 'blank' => false, ), ), array( 'title' => esc_html__( 'Read full documentation', 'hestia' ), 'text' => esc_html__( 'Need more details? Please check our full documentation for detailed information on how to use Hestia.', 'hestia' ), 'button' => array( 'label' => esc_html__( 'Documentation', 'hestia' ), 'link' => 'https://docs.themeisle.com/article/753-hestia-doc?utm_medium=customizer&utm_source=button&utm_campaign=documentation', 'is_button' => false, 'blank' => true, ), ), array( 'title' => esc_html__( 'Go to the Customizer', 'hestia' ), 'text' => esc_html__( 'Using the WordPress Customizer you can easily customize every aspect of the theme.', 'hestia' ), 'button' => array( 'label' => esc_html__( 'Go to the Customizer', 'hestia' ), 'link' => esc_url( admin_url( 'customize.php' ) ), 'is_button' => true, 'blank' => true, ), ), ), ), 'recommended_actions' => array( 'type' => 'recommended_actions', 'title' => __( 'Recommended Actions', 'hestia' ), 'plugins' => array( 'themeisle-companion' => array( 'name' => 'OrbitFox by ThemeIsle', 'slug' => 'themeisle-companion', 'description' => __( 'It is highly recommended that you install the companion plugin to have access to the Frontpage features, Team and Testimonials sections.', 'hestia' ), ), ), ), 'recommended_plugins' => array( 'type' => 'plugins', 'title' => esc_html__( 'Useful Plugins', 'hestia' ), 'plugins' => array( 'optimole-wp', 'themeisle-companion', 'feedzy-rss-feeds', 'otter-blocks', 'elementor', 'visualizer', 'wpforms-lite', 'translatepress-multilingual', ), ), 'support' => array( 'type' => 'columns-3', 'title' => __( 'Support', 'hestia' ), 'content' => array( array( 'icon' => 'dashicons dashicons-sos', 'title' => esc_html__( 'Contact Support', 'hestia' ), 'text' => esc_html__( 'We want to make sure you have the best experience using Hestia, and that is why we have gathered all the necessary information here for you. We hope you will enjoy using Hestia as much as we enjoy creating great products.', 'hestia' ), 'button' => array( 'label' => esc_html__( 'Contact Support', 'hestia' ), 'link' => apply_filters( 'hestia_contact_support_link', 'https://wordpress.org/support/theme/hestia/' ), 'is_button' => true, 'blank' => true, ), ), array( 'icon' => 'dashicons dashicons-book-alt', 'title' => esc_html__( 'Documentation', 'hestia' ), 'text' => esc_html__( 'Need more details? Please check our full documentation for detailed information on how to use Hestia.', 'hestia' ), 'button' => array( 'label' => esc_html__( 'Read full documentation', 'hestia' ), 'link' => 'https://docs.themeisle.com/article/753-hestia-doc?utm_medium=customizer&utm_source=button&utm_campaign=documentation', 'is_button' => false, 'blank' => true, ), ), array( 'icon' => 'dashicons dashicons-portfolio', 'title' => esc_html__( 'Changelog', 'hestia' ), 'text' => esc_html__( 'Want to get the gist on the latest theme changes? Just consult our changelog below to get a taste of the recent fixes and features implemented.', 'hestia' ), 'button' => array( 'label' => esc_html__( 'Changelog', 'hestia' ), 'link' => esc_url( '#changelog' ), 'is_button' => false, 'blank' => false, ), ), array( 'icon' => 'dashicons dashicons-admin-customizer', 'title' => esc_html__( 'Create a child theme', 'hestia' ), 'text' => esc_html__( "If you want to make changes to the theme's files, those changes are likely to be overwritten when you next update the theme. In order to prevent that from happening, you need to create a child theme. For this, please follow the documentation below.", 'hestia' ), 'button' => array( 'label' => esc_html__( 'View how to do this', 'hestia' ), 'link' => 'http://docs.themeisle.com/article/14-how-to-create-a-child-theme', 'is_button' => false, 'blank' => true, ), ), array( 'icon' => 'dashicons dashicons-controls-skipforward', 'title' => esc_html__( 'Speed up your site', 'hestia' ), 'text' => esc_html__( 'If you find yourself in a situation where everything on your site is running very slowly, you might consider having a look at the documentation below where you will find the most common issues causing this and possible solutions for each of the issues.', 'hestia' ), 'button' => array( 'label' => esc_html__( 'View how to do this', 'hestia' ), 'link' => 'http://docs.themeisle.com/article/63-speed-up-your-wordpress-site', 'is_button' => false, 'blank' => true, ), ), array( 'icon' => 'dashicons dashicons-images-alt2', 'title' => esc_html__( 'Build a landing page with a drag-and-drop content builder', 'hestia' ), 'text' => esc_html__( 'In the documentation below you will find an easy way to build a great looking landing page using a drag-and-drop content builder plugin.', 'hestia' ), 'button' => array( 'label' => esc_html__( 'View how to do this', 'hestia' ), 'link' => 'http://docs.themeisle.com/article/219-how-to-build-a-landing-page-with-a-drag-and-drop-content-builder', 'is_button' => false, 'blank' => true, ), ), ), ), 'changelog' => array( 'type' => 'changelog', 'title' => __( 'Changelog', 'hestia' ), ), 'custom_tabs' => array( 'free_pro' => array( 'title' => __( 'Free vs PRO', 'hestia' ), 'render_callback' => array( $this, 'free_pro_render' ), ), ), ); if ( class_exists( 'Themeisle_Onboarding', false ) ) { $config['welcome_notice'] = array( 'type' => 'custom', 'notice_class' => 'ti-welcome-notice updated', 'dismiss_option' => 'hestia_notice_dismissed', 'render_callback' => array( $this, 'welcome_notice_content' ), ); } if ( class_exists( 'TI_About_Page', false ) ) { TI_About_Page::init( apply_filters( 'hestia_about_page_array', $config ) ); } } /** * Free vs Pro tab content */ public function free_pro_render() { $free_pro = array( 'free_theme_name' => 'Hestia', 'pro_theme_name' => 'Hestia Pro', 'pro_theme_link' => apply_filters( 'hestia_upgrade_link_from_child_theme_filter', 'https://themeisle.com/themes/hestia-pro/upgrade/?utm_medium=abouthestia&utm_source=button&utm_campaign=freevspro' ), /* translators: s - theme name */ 'get_pro_theme_label' => sprintf( __( 'Get %s now!', 'hestia' ), 'Hestia Pro' ), 'banner_link' => 'http://docs.themeisle.com/article/647-what-is-the-difference-between-hestia-and-hestia-pro', 'banner_src' => get_template_directory_uri() . '/assets/img/free_vs_pro_banner.png', 'features_type' => 'table', 'features_img' => get_template_directory_uri() . '/assets/img/upgrade.png', 'features' => array( array( 'title' => __( 'Mobile friendly', 'hestia' ), 'description' => __( 'Responsive layout. Works on every device.', 'hestia' ), 'is_in_lite' => true, 'is_in_pro' => true, ), array( 'title' => __( 'WooCommerce Compatible', 'hestia' ), 'description' => __( 'Ready for e-commerce. You can build an online store here.', 'hestia' ), 'is_in_lite' => true, 'is_in_pro' => true, ), array( 'title' => __( 'Frontpage Sections', 'hestia' ), 'description' => __( 'Big title, Features, About, Team, Testimonials, Subscribe, Blog, Contact', 'hestia' ), 'is_in_lite' => true, 'is_in_pro' => true, ), array( 'title' => __( 'Background image', 'hestia' ), 'description' => __( 'You can use any background image you want.', 'hestia' ), 'is_in_lite' => true, 'is_in_pro' => true, ), array( 'title' => __( 'Section Reordering', 'hestia' ), 'description' => __( 'The ability to reorganize your Frontpage Sections more easily and quickly.', 'hestia' ), 'is_in_lite' => false, 'is_in_pro' => true, ), array( 'title' => __( 'Shortcodes for each section', 'hestia' ), 'description' => __( 'Display a frontpage section wherever you like by adding its shortcode in page or post content.', 'hestia' ), 'is_in_lite' => false, 'is_in_pro' => true, ), array( 'title' => __( 'Header Slider', 'hestia' ), 'description' => __( 'You will be able to add more content to your site header with an awesome slider.', 'hestia' ), 'is_in_lite' => false, 'is_in_pro' => true, ), array( 'title' => __( 'Fully Customizable Colors', 'hestia' ), 'description' => __( 'Change colors for the header overlay, header text and navbar.', 'hestia' ), 'is_in_lite' => false, 'is_in_pro' => true, ), array( 'title' => __( 'Jetpack Portfolio', 'hestia' ), 'description' => __( 'Portfolio section with two possible layouts.', 'hestia' ), 'is_in_lite' => false, 'is_in_pro' => true, ), array( 'title' => __( 'Pricing Plans Section', 'hestia' ), 'description' => __( 'A fully customizable pricing plans section.', 'hestia' ), 'is_in_lite' => false, 'is_in_pro' => true, ), array( 'title' => __( 'Quality Support', 'hestia' ), 'description' => __( '24/7 HelpDesk Professional Support', 'hestia' ), 'is_in_lite' => false, 'is_in_pro' => true, ), ), ); $output = ''; if ( ! empty( $free_pro ) ) { if ( ! empty( $free_pro['features_type'] ) ) { echo '
'; echo '
'; switch ( $free_pro['features_type'] ) { case 'image': if ( ! empty( $free_pro['features_img'] ) ) { $output .= ''; if ( ! empty( $free_pro['pro_theme_link'] ) && ! empty( $free_pro['get_pro_theme_label'] ) ) { $output .= '' . wp_kses_post( $free_pro['get_pro_theme_label'] ) . ''; } } break; case 'table': if ( ! empty( $free_pro['features'] ) ) { $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; foreach ( $free_pro['features'] as $feature ) { $output .= ''; if ( ! empty( $feature['title'] ) || ! empty( $feature['description'] ) ) { $output .= ''; } if ( ! empty( $feature['is_in_lite'] ) && ( (bool) $feature['is_in_lite'] === true ) ) { $output .= ''; } else { $output .= ''; } if ( ! empty( $feature['is_in_pro'] ) && ( (bool) $feature['is_in_pro'] === true ) ) { $output .= ''; } else { $output .= ''; } echo ''; } if ( ! empty( $free_pro['pro_theme_link'] ) && ! empty( $free_pro['get_pro_theme_label'] ) ) { $output .= ''; $output .= ''; $output .= ''; $output .= ''; } $output .= ''; $output .= '
' . esc_html( $free_pro['free_theme_name'] ) . '' . esc_html( $free_pro['pro_theme_name'] ) . '
'; $output .= $this->get_feature_title_and_description( $feature ); $output .= '
'; if ( ! empty( $free_pro['banner_link'] ) && ! empty( $free_pro['banner_src'] ) ) { $output .= ''; } $output .= '' . wp_kses_post( $free_pro['get_pro_theme_label'] ) . '
'; } break; } echo $output; echo '
'; echo '
'; } }// End if(). } /** * Display feature title and description * * @param array $feature Feature data. */ public function get_feature_title_and_description( $feature ) { $output = ''; if ( ! empty( $feature['title'] ) ) { $output .= '

' . wp_kses_post( $feature['title'] ) . '

'; } if ( ! empty( $feature['description'] ) ) { $output .= '

' . wp_kses_post( $feature['description'] ) . '

'; } return $output; } /** * Enqueue Customizer Script. */ public function enqueue_customizer_script() { wp_enqueue_script( 'hestia-customizer-preview', get_template_directory_uri() . '/assets/js/admin/customizer.js', array( 'jquery', ), HESTIA_VERSION, true ); } /** * Enqueue customizer controls script. */ public function enqueue_customizer_controls() { wp_enqueue_style( 'hestia-customizer-style', get_template_directory_uri() . '/assets/css/customizer-style' . ( ( HESTIA_DEBUG ) ? '' : '.min' ) . '.css', array(), HESTIA_VERSION ); wp_enqueue_script( 'hestia_customize_controls', get_template_directory_uri() . '/assets/js/admin/customizer-controls.min.js', array( 'jquery', 'wp-color-picker', ), HESTIA_VERSION, true ); wp_localize_script( 'hestia_customize_controls', 'imageObject', array( 'imagenonce' => wp_create_nonce( 'image_nonce' ), 'ajaxurl' => admin_url( 'admin-ajax.php' ), ) ); } /** * Add inline style for editor. * * @param string $init Setup TinyMCE. * * @return mixed */ public function editor_inline_style( $init ) { $editor_style = $this->admin_editor_inline_style(); if ( wp_default_editor() === 'tinymce' ) { $init['content_style'] = $editor_style; } return $init; } /** * Add custom inline style for editor. * * @return string */ private function admin_editor_inline_style() { $accent_color = get_theme_mod( 'accent_color', apply_filters( 'hestia_accent_color_default', '#e91e63' ) ); $headings_font = get_theme_mod( 'hestia_headings_font' ); $body_font = get_theme_mod( 'hestia_body_font' ); $custom_css = ''; // Load google font. if ( ! empty( $body_font ) ) { $custom_css .= '@import url(\'https://fonts.googleapis.com/css?family=' . esc_attr( $body_font ) . '\');'; } if ( ! empty( $headings_font ) ) { $custom_css .= '@import url(\'https://fonts.googleapis.com/css?family=' . esc_attr( $headings_font ) . '\');'; } // Check if accent color is exists. if ( ! empty( $accent_color ) ) { $custom_css .= 'body:not(.elementorwpeditor)#tinymce .mce-content-body a { color: ' . esc_attr( $accent_color ) . '; }'; } // Check if font family for body exists. if ( ! empty( $body_font ) ) { $custom_css .= 'body:not(.elementorwpeditor)#tinymce, body:not(.elementorwpeditor)#tinymce p { font-family: ' . esc_attr( $body_font ) . ' !important; }'; } // Check if font family for headings exists. if ( ! empty( $headings_font ) ) { $custom_css .= 'body:not(.elementorwpeditor)#tinymce h1, body:not(.elementorwpeditor)#tinymce h2, body:not(.elementorwpeditor)#tinymce h3, body:not(.elementorwpeditor)#tinymce h4, body:not(.elementorwpeditor)#tinymce h5, body:not(.elementorwpeditor)#tinymce h6 { font-family: ' . esc_attr( $headings_font ) . ' !important; }'; } return $custom_css; } /** * If conditions are fulfilled this will add the front-page import logic. */ function add_zerif_frontpage_import() { $imported_flag = get_theme_mod( 'zerif_frontpage_was_imported', 'not-zerif' ); if ( $imported_flag === 'yes' || $imported_flag === 'not-zerif' ) { return; } } /** * In case the old theme wasn't Zerif, mark the importer flag to avoid printing the import notice. */ public function maybe_switched_from_zerif() { $old_theme = strtolower( get_option( 'theme_switched' ) ); $content_imported = get_theme_mod( 'zerif_frontpage_was_imported', 'not-zerif' ); if ( $content_imported === 'yes' ) { return; } if ( $content_imported === 'not-zerif' && in_array( $old_theme, array( 'zerif-pro', 'zerif-lite' ), true ) ) { set_theme_mod( 'zerif_frontpage_was_imported', 'no' ); } if ( ! in_array( $old_theme, array( 'zerif-pro', 'zerif-lite' ), true ) ) { set_theme_mod( 'zerif_frontpage_was_imported', 'not-zerif' ); } } /** * Render welcome notice content */ public function welcome_notice_content() { if ( ! $this->should_show_welcome ) { return; } $theme_args = wp_get_theme(); $name = apply_filters( 'ti_wl_theme_name', $theme_args->__get( 'Name' ) ); $template = $theme_args->get( 'Template' ); $slug = $theme_args->__get( 'stylesheet' ); $theme_page = ! empty( $template ) ? $template . '-welcome' : $slug . '-welcome'; $notice_template = '
%1$s
'; $ob_btn = sprintf( /* translators: 1 - options page url, 2 - button text */ '%2$s', esc_url( admin_url( 'customize.php' ) ), esc_html__( 'or customize the theme', 'hestia' ) ); $options_page_btn = sprintf( /* translators: 1 - onboarding url, 2 - button text */ '%2$s', esc_url( admin_url( 'themes.php?page=' . $theme_page . '&onboarding=yes&readyimport=hestia-default#sites_library' ) ), sprintf( esc_html__( 'Import Demo Content', 'hestia' ) ) ); $content = sprintf( /* translators: 1 - notice title, 2 - notice message, 3 - options page button, 4 - starter sites button, 5 - notice closing button */ '

%1$s

%2$s %3$s

', sprintf( /* translators: %s - theme name */ esc_html__( '%s is now installed and ready to use. We\'ve assembled some links to get you started.', 'hestia' ), '' . $name . '' ), $options_page_btn, $ob_btn ); echo sprintf( $notice_template, $content ); } /** * Load site import module. */ public function load_site_import() { if ( class_exists( 'Themeisle_Onboarding', false ) ) { $this->should_show_welcome = true; Themeisle_Onboarding::instance(); } } }