["color" => "red","class" =>"wtotem_alert__img_cross","img" => ""],"info" => ["color" => "","class" => "","img" => ""],"warning" => ["color" => "yellow","class" => "", "img" => ''],"success" => ["color" => "green","class" => "" ,"img" => '']]; 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"].'
'.strtoupper($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)){ $notifications[] = $value; update_option(WTSEC_PLUGIN_PREFIX.$type,$notifications); }else{ update_option(WTSEC_PLUGIN_PREFIX.$type,[$value]); } } }