["color" => "red","class" => "wtotem_alert__img_cross", "img" => ""],"info" => ["color" => "","class" => "","img" => ""],"warning" => ["color" => "yellow","class" => "", "img" => ''],"success" => ["color" => "green","class" => "" ,"img" => '']]; $statuses = wtsec_getStatuses(); foreach ($notification_types as $type) { if ($notifications = get_option(WTSEC_PLUGIN_PREFIX.$type)) { if(is_array($notifications)) { foreach ($notifications as $notification) { $style = $styles[$type]; echo '
'.$style["img"].'
'.$statuses[$type].':

'.$notification.'

'; } } self::deleteNotification($type); } } } protected static function deleteNotification($name){ return delete_option(WTSEC_PLUGIN_PREFIX.$name); } public static function setNotification($type,$value){ if($notifications = get_option(WTSEC_PLUGIN_PREFIX.$type)){ if(!in_array($value,$notifications)){ $notifications[] = $value; update_option(WTSEC_PLUGIN_PREFIX.$type,$notifications); } }else{ update_option(WTSEC_PLUGIN_PREFIX.$type,[$value]); } } public static function _set($name, $value){ $_SESSION[WTSEC_PLUGIN_PREFIX . $name] = $value; } public static function _get($name){ return $_SESSION[WTSEC_PLUGIN_PREFIX . $name]; } }