config = $config; self::$instance->setup_config(); self::$instance->setup_actions(); } } } /** * Setup the class props based on the config array. */ public function setup_config() { $theme = wp_get_theme(); if ( is_child_theme() ) { $this->theme_name = $theme->parent()->get( 'Name' ); $this->theme_slug = $theme->parent()->get_template(); } else { $this->theme_name = $theme->get( 'Name' ); $this->theme_slug = $theme->get_template(); } $this->theme_version = $theme->get( 'Version' ); $this->menu_name = sprintf( __( 'About %s', 'brilliant' ), $this->theme_name); $this->page_name = sprintf( __( 'About %s', 'brilliant' ), $this->theme_name); $this->theme_pro_name = isset( $this->config['theme_pro_name'] ) ? $this->config['theme_pro_name'] : ' Pro'; $this->theme_pro_slug = isset( $this->config['theme_pro_slug'] ) ? $this->config['theme_pro_slug'] : '-pro'; $this->tabs = isset( $this->config['tabs'] ) ? $this->config['tabs'] : array(); $this->notification = isset( $this->config['notification'] ) ? $this->config['notification'] : ''; $this->utm = isset( $this->config['utm'] ) ? $this->config['utm'] : ''; } /** * Setup the actions used for this page. */ public function setup_actions() { add_action( 'admin_menu', array( $this, 'about_page_register' ) ); /* Activation notice */ add_action( 'load-themes.php', array( $this, 'activation_admin_notice' ) ); /* Enqueue script and style for about page */ add_action( 'admin_enqueue_scripts', array( $this, 'style_and_scripts' ) ); } /** * Register the menu page under Appearance menu. */ function about_page_register() { if ( ! empty( $this->menu_name ) && ! empty( $this->page_name ) ) { $title = $this->page_name . ' i ' ; add_theme_page( $this->menu_name, $title, 'activate_plugins', $this->theme_slug . '-welcome', array( $this, 'about_page_render', ) ); } } /** * Adds an admin notice upon successful activation. */ public function activation_admin_notice() { global $pagenow; if ( is_admin() && ( 'themes.php' == $pagenow ) && isset( $_GET['activated'] ) ) { add_action( 'admin_notices', array( $this, 'about_page_admin_notice' ), 99 ); } } /** * Display an Admin notice linking to the about page. */ public function about_page_admin_notice() { if ( ! empty( $this->notification ) ) { echo '
'; echo wp_kses_post( $this->notification ); echo '
'; } } /** * Render the main content page. */ public function about_page_render() { echo '
'; echo '
'; echo '
'; if ( ! empty( $this->config['welcome_title'] ) ) { $welcome_title = $this->config['welcome_title']; } if ( ! empty( $this->config['welcome_content'] ) ) { $welcome_content = $this->config['welcome_content']; } /* Display About Title */ if ( ! empty( $welcome_title ) ) { echo '

' . esc_html( $welcome_title ) . '

'; } /* Display About Text */ echo '
'; if ( ! empty( $welcome_content ) ) { echo '

' . wp_kses_post( $welcome_content ) . '

'; } echo '
'; echo '
'; /* Display tabs */ if ( ! empty( $this->tabs ) ) { $active_tab = isset( $_GET['tab']) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'getting_started'; echo ''; } echo '
'; echo '
'; /* Display content for current tab */ if ( ! empty( $this->tabs ) ) { if ( method_exists( $this, $active_tab ) ) { $this->$active_tab(); } } echo '
'; echo '
'; } /** * Getting started tab */ public function getting_started() { echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '

' . wp_kses_post( sprintf( __( 'Upgrade to %s', 'brilliant' ), $this->theme_pro_name ) ) . '

'; echo '

' . wp_kses_post( sprintf( __( 'If you ♥ %1$s, you’ll love all the extra features %2$s come with.', 'brilliant' ), $this->theme_name, $this->theme_pro_name ) ) . '

'; echo ''; echo '

' . esc_html( sprintf( __( 'Get %s now', 'brilliant' ), $this->theme_pro_name ) ) . '

'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo '

' . esc_html( 'Read Full Documentation', 'brilliant' ) . '

'; echo '

' . esc_html( 'Need any help to setup and configure the theme? Please check our full documentation for detailed information on how to use it.', 'brilliant' ) . '

' . esc_html( 'Read Documentation', 'brilliant' ) . '

'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo '

' . esc_html( 'Customize your site', 'brilliant' ) . '

'; echo '

' . esc_html( 'Using the WordPress Customizer you can easily customize every aspect of the theme.', 'brilliant' ) . '

' . esc_html( 'Start Customize', 'floral-lite' ) . '

'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo '

' . esc_html( 'Rate us', 'brilliant' ) . '

'; echo '

' . wp_kses_post( sprintf( __( 'Please rate us ★★★★★ on WordPress.org to help us spread the word. Thank you from Design Lab Themes!', 'brilliant' ), $this->theme_slug ) ) . '

'; echo '
'; echo '
'; echo '
'; echo '
'; } /** * Free vs PRO tab */ public function free_pro() { echo '
'; echo '
'; echo '
'; echo '

' . wp_kses_post( sprintf( __( 'Need more customizations and flexibility? Try %s', 'brilliant' ), $this->theme_pro_name ) ) . '

'; echo '

theme_pro_slug-wordpress-theme/$this->utm" ) . '" target="_blank" class="button button-primary button-hero">' . esc_html( sprintf( __( 'Get %s now', 'brilliant' ), $this->theme_pro_name ) ) . '

'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
' . esc_html( 'Free', 'brilliant' ) . '' . esc_html( 'PRO', 'brilliant' ) . '

' . esc_html( 'Basic Theme Customization', 'brilliant' ) . '

' . esc_html( 'Pick an accent color, upload your logo, and easily customize your website', 'brilliant' ) . '

' . esc_html( 'Gutenberg-First', 'brilliant' ) . '

' . esc_html( sprintf( __( '%s is optimized for the block editor with nice styling for blocks and combinations.', 'brilliant' ), $this->theme_name ) ) . '

' . esc_html( 'Fast loading', 'brilliant' ) . '

' . esc_html( sprintf( __( 'With %s your website loads fast and runs smoothly.', 'brilliant' ), $this->theme_name ) ) . '

' . esc_html( 'SEO Ready & AMP Support', 'brilliant' ) . '

' . esc_html( 'Each page is search-engine-optimized (SEO) and fully AMP compatible (Official AMP plugin required)', 'brilliant' ) . '

' . esc_html( 'Priority Support', 'brilliant' ) . '

' . esc_html( 'You will benefit of our full support for any issues you have with the theme.', 'brilliant' ) . '

' . esc_html( 'Homepage Template', 'brilliant' ) . '

' . esc_html( 'Create a stunning Homepage in minutes with smart customization options.', 'brilliant' ) . '

' . esc_html( 'Full support for WooCommerce', 'brilliant' ) . '

' . esc_html( 'Set up shop and start selling immediately with WooCommerce Plugin.', 'brilliant' ) . '

' . esc_html( 'Advanced Theme Customization', 'brilliant' ) . '

' . esc_html( 'Make your website unique with multiple Layout Options, Header Options, Post Slider, and more!', 'brilliant' ) . '

' . esc_html( 'Colors and Typography', 'brilliant' ) . '

' . esc_html( 'Easily adjust theme elements\' color, font-family, and font styles.', 'brilliant' ) . '

theme_pro_slug-wordpress-theme/$this->utm" ) . '" target="_blank" class="button button-primary button-hero">' . esc_html( sprintf( __( 'Get %s now', 'brilliant' ), $this->theme_pro_name ) ) . '
'; echo '
'; } /** * Support tab */ public function support() { } /** * Load CSS and scripts for the About Page. */ public function style_and_scripts( $hook_suffix ) { if ( 'appearance_page_' . $this->theme_slug . '-welcome' == $hook_suffix ) { wp_enqueue_style( $this->theme_slug . '-about-page-css', get_template_directory_uri() . '/inc/about-page/css/about_page_style.css', array(), '1.0.2' ); } } } }