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 ogma_blog_enqueue_scripts() { wp_enqueue_style( 'ogma-blog-admin-style', get_template_directory_uri() . '/inc/admin/assets/css/admin.css', array(), ogma_blog_VERSION ); wp_enqueue_script( 'ogma-blog-plugin-install-helper', get_template_directory_uri() . '/inc/admin/assets/js/plugin-handle.js', array( 'jquery' ), ogma_blog_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( 'ogma-blog-plugin-install-helper', 'ogAdminObject', array( 'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ), '_wpnonce' => wp_create_nonce( 'ogma_blog_plugin_install_nonce' ), 'buttonStatus' => esc_html( $action ) ) ); } /** * Add admin welcome notice. */ public function ogma_blog_welcome_notice() { if ( isset( $_GET['activated'] ) ) { update_option( 'ogma_blog_admin_notice_welcome', true ); } $welcome_notice_option = get_option( 'ogma_blog_admin_notice_welcome' ); // Let's bail on theme activation. if ( $welcome_notice_option ) { add_action( 'admin_notices', array( $this, 'ogma_blog_welcome_notice_html' ) ); } } /** * Hide a notice if the GET variable is set. */ public static function ogma_blog_hide_welcome_notices() { if ( isset( $_GET['ogma-blog-hide-welcome-notice'] ) && isset( $_GET['_ogma_blog_welcome_notice_nonce'] ) ) { if ( ! wp_verify_nonce( $_GET['_ogma_blog_welcome_notice_nonce'], 'ogma_blog_hide_welcome_notices_nonce' ) ) { wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'ogma-blog' ) ); } if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'Cheat in ’ huh?', 'ogma-blog' ) ); } $hide_notice = sanitize_text_field( $_GET['ogma-blog-hide-welcome-notice'] ); update_option( 'ogma_blog_admin_notice_' . $hide_notice, false ); } } /** * function to display welcome notice section */ public function ogma_blog_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. Let them serve you with ease. get started button will process to installation of Mystery Themes Demo Importer Plugin and redirect to the theme settings page. In order to summon %1$s theme settings, click on the Theme Settings buton in below.
And Thank so much for being a part of us.', 'ogma-blog' ), $this->theme_name ); ?>

%1$s looks like? You can browse from our demos and see the live previews before you get started.', 'ogma-blog' ), $this->theme_name ); ?>

%1$s and its functionality. Let this detailed documentation navigate you through any confusion along the way. Cheers!', 'ogma-blog' ), $this->theme_name ); ?>