display( 'Name' ), $bridal_store_theme->display( 'Name' ), 'manage_options', 'bridal-store', 'bridal_store_do_admin_page' ); } add_action( 'admin_menu', 'bridal_store_admin_menu_page' ); /** * Enqueue getting started styles and scripts */ function titan_widgets_backend_enqueue() { wp_enqueue_style( 'titan-getting-started', get_template_directory_uri() . '/about-theme/about-theme.css' ); // Enqueue your admin notice JS wp_enqueue_script( 'titan-admin-notice', get_template_directory_uri() . '/about-theme/admin-notice-script.js', array('jquery'), // dependencies '1.0', true ); // Pass PHP data to JS wp_localize_script( 'titan-admin-notice', 'bridal_store', array( 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('bridal_store_nonce'), ) ); } add_action( 'admin_enqueue_scripts', 'titan_widgets_backend_enqueue' ); /** * Class Titan_Notice_Handler */ class Titan_Notice_Handler { public static $nonce; /** * Empty Constructor */ public function __construct() { // Activation notice add_action( 'switch_theme', array( $this, 'flush_dismiss_status' ) ); add_action( 'admin_init', array( $this, 'getting_started_notice_dismissed' ) ); add_action( 'admin_notices', array( $this, 'titan_theme_info_welcome_admin_notice' ), 3 ); add_action( 'wp_ajax_bridal_store_dismissable_notice', array( $this, 'ajax_dismiss_notice' ) ); add_action( 'wp_ajax_titan_getting_started', array( $this, 'titan_getting_started' ) ); } /** * Display an admin notice linking to the about page */ public function titan_theme_info_welcome_admin_notice() { $current_screen = get_current_screen(); $bridal_store_theme = wp_get_theme(); if ( is_admin() && ! get_user_meta( get_current_user_id(), 'gs_notice_dismissed' ) && $current_screen->base != 'appearance_page_bridal-store' ) { echo '
' . sprintf( esc_html__( 'Welcome! Thank you for choosing %1$s.', 'bridal-store' ), esc_html( $bridal_store_theme->get( 'Name' ) ) ) . '
'; echo '' . esc_html__( 'Thank you for choosing this theme. Use the Get Started guide to quickly set up and personalize your website.', 'bridal-store' ) . '
'; echo ''; echo '
';
echo '