| 1 |
<?php |
| 2 |
function osc_theme_notification($atts, $content = null ) { |
| 3 |
extract(shortcode_atts(array( |
| 4 |
'type' => '', |
| 5 |
'close' => 'false', |
| 6 |
), $atts)); |
| 7 |
$type = ($close == 'true' ? $type.' alert-dismissable' : $type); |
| 8 |
|
| 9 |
$result = '<div class="alert '.$type.'">'; |
| 10 |
if ($close == 'true') { |
| 11 |
$result .= '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>'; |
| 12 |
} |
| 13 |
$result .= do_shortcode($content); |
| 14 |
$result .= '</div>'; |
| 15 |
|
| 16 |
return $result; |
| 17 |
} |
| 18 |
add_shortcode('notification', 'osc_theme_notification'); |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|