theme_screenshot = get_template_directory_uri()."/screenshot.png"; } else { $this->theme_screenshot = get_stylesheet_directory_uri()."/screenshot.png"; } $this->theme_name = $theme->get( 'Name' ); } /** * Localize array for import button AJAX request. */ public function blogbuster_enqueue_scripts() { wp_enqueue_style( 'blogbuster-admin-style', get_template_directory_uri() . '/inc/admin/assets/css/admin.css', array(), BLOGBUSTER_VERSION ); wp_enqueue_script( 'blogbuster-plugin-install-helper', get_template_directory_uri() . '/inc/admin/assets/js/plugin-handle.js', array( 'jquery' ), BLOGBUSTER_VERSION ); $demo_importer_plugin = WP_PLUGIN_DIR . '/mysterythemes-demo-importer/mysterythemes-demo-importer.php'; if ( ! file_exists( $demo_importer_plugin ) ) { $action = 'install'; } elseif ( file_exists( $demo_importer_plugin ) && !is_plugin_active( 'mysterythemes-demo-importer/mysterythemes-demo-importer.php' ) ) { $action = 'activate'; } else { $action = 'redirect'; } wp_localize_script( 'blogbuster-plugin-install-helper', 'mtAdminObject', array( 'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ), '_wpnonce' => wp_create_nonce( 'blogbuster_plugin_install_nonce' ), 'buttonStatus' => esc_html( $action ) ) ); } /** * Add admin welcome notice. */ public function blogbuster_welcome_notice() { if ( isset( $_GET['activated'] ) ) { update_option( 'blogbuster_admin_notice_welcome', true ); } $welcome_notice_option = get_option( 'blogbuster_admin_notice_welcome' ); // Let's bail on theme activation. if ( $welcome_notice_option ) { add_action( 'admin_notices', array( $this, 'blogbuster_welcome_notice_html' ) ); } } /** * Hide a notice if the GET variable is set. */ public static function blogbuster_hide_welcome_notices() { if ( isset( $_GET['blogbuster-hide-welcome-notice'] ) && isset( $_GET['_blogbuster_welcome_notice_nonce'] ) ) { if ( ! wp_verify_nonce( $_GET['_blogbuster_welcome_notice_nonce'], 'blogbuster_hide_welcome_notices_nonce' ) ) { wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'blogbuster' ) ); } if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'Cheat in ’ huh?', 'blogbuster' ) ); } $hide_notice = sanitize_text_field( $_GET['blogbuster-hide-welcome-notice'] ); update_option( 'blogbuster_admin_notice_' . $hide_notice, false ); } } /** * function to display welcome notice section */ public function blogbuster_welcome_notice_html() { $current_screen = get_current_screen(); if ( $current_screen->id !== 'dashboard' && $current_screen->id !== 'themes' ) { return; } ?>

theme_name ); ?>

%1$s are now at your disposal. Our theme has been successfully installed and is ready to use, offering a range of various powerful features for your website. To begin, click on the Get Started button to install the Mystery Themes Demo Importer Plugin and quickly access the theme settings page. Alternatively, you can directly click on Customize your site to quickly begin the customization of your website. Thank you for choosing us and being part of our community.!', 'blogbuster' ), $this->theme_name ); ?>