/** * Get all error messages * * @since 3.2 * @return array */ function wpas_get_errors() { return wpas_get_notifications('errors'); }
/** * Get all notifications in a human readable format * * @since 3.2 * * @param string $group Group of notifications to lookup * @param string $type Type of markup to use * * @return string */ function wpas_get_display_notifications($group = 'notifications', $type = 'success') { $notifications = wpas_get_notifications($group); $text = ''; if (!is_array($notifications)) { $text = $notifications; } else { if (count($notifications) >= 2) { $messages = array(); foreach ($notifications as $id => $message) { array_push($messages, wpas_readable_notification_message($message)); } $text = implode('<br>', $messages); } else { foreach ($notifications as $id => $message) { $text = wpas_readable_notification_message($message); } } } return wpas_get_notification_markup($type, $text); }