| @@ -1,40 +1,26 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - exit; | |
| 4 | -} | |
| 5 | -use EBS\Security\Sanitizer; | |
| 6 | 2 | |
| 7 | 3 | /* * ********************************************************* |
| 8 | 4 | * BUTTONS |
| 9 | 5 | * ********************************************************* */ |
| 10 | 6 | |
| 11 | -function osc_theme_progressbar( $params, $content = null ) { | |
| 12 | - $atts = shortcode_atts( | |
| 13 | - array( | |
| 14 | - 'value' => '50', | |
| 15 | - 'barstyle' => '', | |
| 16 | - 'bartype' => '', | |
| 17 | - 'class' => '', | |
| 18 | - 'label' => '', | |
| 19 | - ), | |
| 20 | - $params | |
| 21 | - ); | |
| 22 | - | |
| 23 | - $value = Sanitizer::int( $atts['value'] ); | |
| 24 | - $barstyle = Sanitizer::class_list( $atts['barstyle'] ); | |
| 25 | - $bartype = Sanitizer::class_list( $atts['bartype'] ); | |
| 26 | - $class = Sanitizer::class_list( $atts['class'] ); | |
| 27 | - $label = Sanitizer::html( $atts['label'] ); | |
| 28 | - | |
| 29 | - $out = '' !== $atts['label'] ? '<div class="osc_bar_outer"><label class="osc-progressbar-label' . EBS_CONTAINER_CLASS . '">' . $label . '</label>' : ''; | |
| 30 | - $out .= '<div class="progress ' . $barstyle . ' ' . $class . ' osc-progressbar' . EBS_CONTAINER_CLASS . '"> | |
| 31 | - <div class="progress-bar ' . $bartype . EBS_CONTAINER_CLASS . '" role="progressbar" aria-valuenow="' . $value . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $value . '%"> | |
| 32 | - <span class="sr-only' . EBS_CONTAINER_CLASS . '">' . $value . '% Complete</span> | |
| 7 | +function osc_theme_progressbar($params, $content = null) { | |
| 8 | + extract(shortcode_atts(array( | |
| 9 | + 'value' => '50', | |
| 10 | + 'barstyle' => '', | |
| 11 | + 'bartype' => '', | |
| 12 | + 'class' => '', | |
| 13 | + 'label' => '' | |
| 14 | + ), $params)); | |
| 15 | + $out = $label != '' ? '<div class="osc_bar_outer"><label class="osc-progressbar-label">' . $label . '</label>' : ''; | |
| 16 | + $out.='<div class="progress ' . $barstyle . ' ' . $class . ' osc-progressbar"> | |
| 17 | + <div class="progress-bar ' . $bartype . '" role="progressbar" aria-valuenow="' . $value . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $value . '%"> | |
| 18 | + <span class="sr-only">' . $value . '% Complete</span> | |
| 33 | 19 | </div> |
| 34 | 20 | </div>'; |
| 35 | - $out .= '' !== $atts['label'] ? '</div>' : ''; | |
| 36 | - | |
| 21 | + $out .= $label != '' ?'</div>':''; | |
| 37 | 22 | return $out; |
| 38 | 23 | } |
| 39 | 24 | |
| 40 | -ebs_backward_compatibility_callback( 'progressbar', 'osc_theme_progressbar' ); | |
| 25 | +add_shortcode('progressbar', 'osc_theme_progressbar'); | |
| 26 | + | |