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 '
' . wp_kses_post( $welcome_content ) . '
'; } 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 '' . esc_html( sprintf( __( 'Get %s now', 'brilliant' ), $this->theme_pro_name ) ) . '
'; echo '' . wp_kses_post( sprintf( __( 'Need more customizations and flexibility? Try %s', 'brilliant' ), $this->theme_pro_name ) ) . '
'; echo ''; echo '| '; echo ' | ' . esc_html( 'Free', 'brilliant' ) . ' | '; echo '' . esc_html( 'PRO', 'brilliant' ) . ' | '; echo '
|---|---|---|
' . esc_html( 'Basic Theme Customization', 'brilliant' ) . '' . esc_html( 'Pick an accent color, upload your logo, and easily customize your website', 'brilliant' ) . ' | ';
echo ''; echo ' | '; echo ' |
' . 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 ) ) . ' | ';
echo ''; echo ' | '; echo ' |
' . esc_html( 'Fast loading', 'brilliant' ) . '' . esc_html( sprintf( __( 'With %s your website loads fast and runs smoothly.', 'brilliant' ), $this->theme_name ) ) . ' | ';
echo ''; echo ' | '; echo ' |
' . 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' ) . ' | ';
echo ''; echo ' | '; echo ' |
' . esc_html( 'Priority Support', 'brilliant' ) . '' . esc_html( 'You will benefit of our full support for any issues you have with the theme.', 'brilliant' ) . ' | ';
echo ''; echo ' | '; echo ' |
' . esc_html( 'Homepage Template', 'brilliant' ) . '' . esc_html( 'Create a stunning Homepage in minutes with smart customization options.', 'brilliant' ) . ' | ';
echo ''; echo ' | '; echo ' |
' . esc_html( 'Full support for WooCommerce', 'brilliant' ) . '' . esc_html( 'Set up shop and start selling immediately with WooCommerce Plugin.', 'brilliant' ) . ' | ';
echo ''; echo ' | '; echo ' |
' . esc_html( 'Advanced Theme Customization', 'brilliant' ) . '' . esc_html( 'Make your website unique with multiple Layout Options, Header Options, Post Slider, and more!', 'brilliant' ) . ' | ';
echo ''; echo ' | '; echo ' |
' . esc_html( 'Colors and Typography', 'brilliant' ) . '' . esc_html( 'Easily adjust theme elements\' color, font-family, and font styles.', 'brilliant' ) . ' | ';
echo ''; echo ' | '; echo ' |
| '; 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 '|