| @@ -1,44 +1,27 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - exit; | |
| 4 | -} | |
| 5 | -use EBS\Security\Sanitizer; | |
| 6 | 2 | |
| 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>'; | |
| 3 | +function osc_theme_list($params, $content = null) { | |
| 4 | + extract(shortcode_atts(array( | |
| 5 | + 'class' => '' | |
| 6 | + ), $params)); | |
| 7 | + $content = str_replace("]<br />", ']', $content); | |
| 8 | + $content = str_replace("]<br />\n", ']', $content); | |
| 9 | + $content = str_replace("<br />\n[", '[', $content); | |
| 10 | + return '<ul class="list-group ' . $class . '">' . do_shortcode($content) . '</ul>'; | |
| 22 | 11 | } |
| 23 | 12 | |
| 24 | -ebs_backward_compatibility_callback( 'list', 'osc_theme_list' ); | |
| 13 | +add_shortcode('list', 'osc_theme_list'); | |
| 25 | 14 | |
| 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>'; | |
| 15 | +function osc_theme_li($params, $content = null) { | |
| 16 | + extract(shortcode_atts(array( | |
| 17 | + 'type' => '' | |
| 18 | + ), $params)); | |
| 19 | + if ($type != '') { | |
| 20 | + $osc_class = '<span class="glyphicon ' . $type . '"></span> '; | |
| 21 | + } else { | |
| 22 | + $osc_class = ''; | |
| 23 | + } | |
| 24 | + return '<li class="list-group-item">' . $osc_class . do_shortcode($content) . '</li>'; | |
| 42 | 25 | } |
| 43 | 26 | |
| 44 | -ebs_backward_compatibility_callback( 'li', 'osc_theme_li' ); | |
| 27 | +add_shortcode('li', 'osc_theme_li'); | |