. * * ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗ * ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝ * ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝ * ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗ * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗ * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ */ if ( ! defined( 'ABSPATH' ) ) { die( 'Kangaroos cannot jump here' ); } class Ai1wm_Message { public static function flash( $type, $message ) { if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) !== false ) { return update_option( AI1WM_MESSAGES, array_merge( $messages, array( $type => $message ) ) ); } return false; } public static function has( $type ) { if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) ) { if ( isset( $messages[ $type ] ) ) { return true; } } return false; } public static function get( $type ) { $message = null; if ( ( $messages = get_option( AI1WM_MESSAGES, array() ) ) ) { if ( isset( $messages[ $type ] ) && ( $message = $messages[ $type ] ) ) { unset( $messages[ $type ] ); } // Set messages update_option( AI1WM_MESSAGES, $messages ); } return $message; } }