# easy-bootstrap-shortcodes/trunk/shortcode/notifications/plugin_shortcode.php

Easy Bootstrap Shortcode, version trunk. 36 lines.

- Page: https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/trunk/code/shortcode/notifications/plugin_shortcode.php
- Raw: https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/trunk/raw/shortcode/notifications/plugin_shortcode.php
- Modified: 2026-08-06T19:58:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/trunk/code/shortcode/notifications/plugin_shortcode.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
use EBS\Security\Sanitizer;

function osc_theme_notification( $atts, $content = null ) {
	$atts = shortcode_atts(
		array(
			'type'  => '',
			'close' => 'false',
			'class' => '',
		),
		$atts
	);

	$type  = Sanitizer::class_list( $atts['type'] );
	$class = Sanitizer::class_list( $atts['class'] );

	if ( 'true' === $atts['close'] ) {
		$type .= ' alert-dismissable';
	}

	$result  = '<div class = "alert ' . $type . ' ' . $class . EBS_CONTAINER_CLASS . '">';
	if ( 'true' === $atts['close'] ) {
		$result .= '<button type = "button" class = "close' . EBS_CONTAINER_CLASS . '" data-dismiss = "alert" aria-hidden = "true">&times;
    </button>';
	}
	$result .= do_shortcode( $content );
	$result .= '</div>';

	return $result;
}

ebs_backward_compatibility_callback( 'notification', 'osc_theme_notification' );

```
