PluginProbe
Easy Bootstrap Shortcode / 3.7
Easy Bootstrap Shortcode v3.7
trunk 2.4.0 2.5 3.4 3.5 3.6 3.7 4.0.0 4.4 4.5 4.5.4 5.0.0 5.0.1 5.0.2
← All changes | shortcode/icon/plugin_shortcode.php +7 -33 trunk3.7 View file →
@@ -1,9 +1,5 @@
1 1 <?php
2 -if ( ! defined( 'ABSPATH' ) ) {
3 - exit;
4 -}
5 -use EBS\Security\Sanitizer;
6 2
7 3 /* * *********************************************************
8 4 * BUTTONS
9 5 * ********************************************************* */
@@ -8,36 +4,14 @@
8 4 * BUTTONS
9 5 * ********************************************************* */
10 6
11 7 function osc_theme_icon($params, $content = null) {
12 - $atts = shortcode_atts(array(
13 - 'type' => '',
14 - 'color' => '',
15 - 'class' => '',
16 - 'fontsize' => ''
17 - ), $params);
18 -
19 - $type = Sanitizer::class_list( $atts['type'] );
20 - $class = Sanitizer::class_list( $atts['class'] );
21 - $color = Sanitizer::hex_color( $atts['color'] );
22 - $fontsize = Sanitizer::int( $atts['fontsize'] );
23 -
24 - $style_parts = array();
25 - if ( $color !== '' ) {
26 - $style_parts[] = 'color:' . $color . ';';
27 - }
28 - if ( $fontsize !== 0 ) {
29 - $style_parts[] = 'font-size:' . $fontsize . 'px;';
30 - }
31 - $style = implode( '', $style_parts );
32 -
33 - $iconcount = explode( ' ', $atts['type'] );
34 - array_filter( $iconcount );
35 - if ( count( $iconcount ) === 1 ) {
36 - $type = 'glyphicon ' . $type;
37 - }
38 -
39 - $out = '<i class=" ' . $type . ' ' . $class . '" style="' . $style . '"></i>';
8 + extract(shortcode_atts(array(
9 + 'type' => '',
10 + 'class' => '',
11 + ), $params));
12 + $out = '<i class="glyphicon ' . $type . ' ' . $class . '"></i>';
40 13 return $out;
41 14 }
42 15
43 -ebs_backward_compatibility_callback('icon', 'osc_theme_icon');
16 +add_shortcode('icon', 'osc_theme_icon');
17 +