$id, ); $classes = array( 'ogrealert-message', ); $style = array( 'display' => 'none', ); // Priority $priority = get_post_meta($id, '_ogrealert_priority', true); if (empty($priority)) $priority = 'normal'; $data['priority'] = $priority; $classes[] = "ogrealert-message__priority-{$priority}"; $style['background-color'] = \OgreAlert\Settings::get("message_{$priority}_background_color"); $style['color'] = \OgreAlert\Settings::get("message_{$priority}_text_color"); // Dismiss Duration $dismiss_type = get_post_meta($id, '_ogrealert_duration', true); if (empty($dismiss_type)) $dismiss_type = \OgreAlert\Settings::get('message_dismiss_duration'); $dismiss_duration = \OgreAlert\Settings::parse_dismiss_duration($dismiss_type); $data['dismiss-type'] = $dismiss_type; $data['dismiss-duration'] = $dismiss_duration; $classes[] = "ogrealert-message__dismiss-{$dismiss_type}"; // Filter Attribute Arrays $data = apply_filters('ogrealert/message_template_data', $data, $id); $classes = apply_filters('ogrealert/message_template_classes', $classes, $id); $style = apply_filters('ogrealert/message_template_style', $style, $id); // Format data attributes array_walk($data, function (&$value, $prop) { $value = "data-{$prop}=\"" . esc_attr($value) . '"'; }); // Format styling array_walk($style, function (&$value, $prop) { $value = "{$prop}: {$value};"; }); ?>