| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
use EBS\Security\Sanitizer; |
| 6 |
|
| 7 |
function osc_theme_list( $params, $content = null ) { |
| 8 |
$atts = shortcode_atts( |
| 9 |
array( |
| 10 |
'class' => '', |
| 11 |
), |
| 12 |
$params |
| 13 |
); |
| 14 |
|
| 15 |
$content = str_replace( ']<br />', ']', $content ); |
| 16 |
$content = str_replace( "]<br />\n", ']', $content ); |
| 17 |
$content = str_replace( "<br />\n[", '[', $content ); |
| 18 |
|
| 19 |
$class = Sanitizer::class_list( $atts['class'] ); |
| 20 |
|
| 21 |
return '<ul class="list-group ' . $class . EBS_CONTAINER_CLASS . '">' . do_shortcode( $content ) . '</ul>'; |
| 22 |
} |
| 23 |
|
| 24 |
ebs_backward_compatibility_callback( 'list', 'osc_theme_list' ); |
| 25 |
|
| 26 |
function osc_theme_li( $params, $content = null ) { |
| 27 |
$atts = shortcode_atts( |
| 28 |
array( |
| 29 |
'type' => '', |
| 30 |
), |
| 31 |
$params |
| 32 |
); |
| 33 |
|
| 34 |
$type = Sanitizer::class_list( $atts['type'] ); |
| 35 |
if ( '' !== $type ) { |
| 36 |
$osc_class = '<span class="glyphicon ' . $type . '"></span> '; |
| 37 |
} else { |
| 38 |
$osc_class = ''; |
| 39 |
} |
| 40 |
|
| 41 |
return '<li class="list-group-item' . EBS_CONTAINER_CLASS . '">' . $osc_class . do_shortcode( $content ) . '</li>'; |
| 42 |
} |
| 43 |
|
| 44 |
ebs_backward_compatibility_callback( 'li', 'osc_theme_li' ); |
| 45 |
|