| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
use EBS\Security\Sanitizer; |
| 6 |
|
| 7 |
/* * ********************************************************* |
| 8 |
* Jumbotron |
| 9 |
* ********************************************************* */ |
| 10 |
|
| 11 |
function osc_theme_jumbotron( $params, $content = 'Label' ) { |
| 12 |
$atts = shortcode_atts( |
| 13 |
array( |
| 14 |
'bgcolor' => '', |
| 15 |
'class' => '', |
| 16 |
), |
| 17 |
$params |
| 18 |
); |
| 19 |
|
| 20 |
$out = ''; |
| 21 |
$content = str_replace( '<br class="osc" />', '', $content ); |
| 22 |
$content = str_replace( '<br class="osc" />\n', '', $content ); |
| 23 |
|
| 24 |
$class = Sanitizer::class_list( $atts['class'] ); |
| 25 |
$style_attr = ''; |
| 26 |
if ( '' !== $atts['bgcolor'] ) { |
| 27 |
$style_attr = ' style="background:' . Sanitizer::hex_color( $atts['bgcolor'] ) . ';"'; |
| 28 |
} |
| 29 |
|
| 30 |
$out = '<div class="jumbotron ' . $class . EBS_CONTAINER_CLASS . '"' . $style_attr . '>' . do_shortcode( $content ) . '</div>'; |
| 31 |
|
| 32 |
return $out; |
| 33 |
} |
| 34 |
|
| 35 |
ebs_backward_compatibility_callback( 'jumbotron', 'osc_theme_jumbotron' ); |
| 36 |
|