get('Version') ); // Let's bail on theme activation. if ( 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) { add_action( 'admin_notices', array( $this, 'welcome_notice' ) ); update_option( 'attesa_admin_notice_welcome', 1 ); // No option? Let run the notice wizard again.. } elseif( ! get_option( 'attesa_admin_notice_welcome' ) ) { add_action( 'admin_notices', array( $this, 'welcome_notice' ) ); } } /** * Hide a notice if the GET variable is set. */ public static function hide_notices() { if ( isset( $_GET['attesa-hide-notice'] ) && isset( $_GET['_attesa_notice_nonce'] ) ) { if ( ! wp_verify_nonce( sanitize_key($_GET['_attesa_notice_nonce'] ), 'attesa_hide_notices_nonce' ) ) { wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'attesa' ) ); } if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'Cheatin’ huh?', 'attesa' ) ); } $hide_notice = sanitize_text_field( wp_unslash($_GET['attesa-hide-notice'] )); update_option( 'attesa_admin_notice_' . $hide_notice, 1 ); } } /** * Show welcome notice. */ public function welcome_notice() { ?>