PluginProbe
Easy Bootstrap Shortcode / trunk
Easy Bootstrap Shortcode vtrunk
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
easy-bootstrap-shortcodes / shortcode / panel / plugin_shortcode.php

plugin_shortcode.php in Easy Bootstrap Shortcode trunk, at shortcode/panel/plugin_shortcode.php

53 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5 use EBS\Security\Sanitizer;
6
7 function osc_theme_panel($atts, $content = null) {
8 $atts = shortcode_atts(array(
9 'style' => '',
10 'class' => ''
11 ), $atts);
12
13 $style = Sanitizer::class_list( $atts['style'] );
14 $class = Sanitizer::class_list( $atts['class'] );
15
16 $content = str_replace("]<br />", ']', $content);
17 $content = str_replace("<br />\n[", '[', $content);
18 $result = '<div class="panel ' . $style . ' ' . $class . EBS_CONTAINER_CLASS . '">';
19 $result .= do_shortcode($content);
20 $result .= '</div>';
21
22 return $result;
23 }
24
25 ebs_backward_compatibility_callback('panel', 'osc_theme_panel');
26
27 function osc_theme_panel_footer($atts, $content = null) {
28 $result = '<div class="panel-footer' . EBS_CONTAINER_CLASS . '">';
29 $result .= do_shortcode($content);
30 $result .= '</div>';
31 return $result;
32 }
33
34 ebs_backward_compatibility_callback('panel-footer', 'osc_theme_panel_footer');
35
36 function osc_theme_panel_heading($atts, $content = null) {
37 $result = '<div class="panel-heading' . EBS_CONTAINER_CLASS . '">';
38 $result .= do_shortcode($content);
39 $result .= '</div>';
40 return $result;
41 }
42
43 ebs_backward_compatibility_callback('panel-header', 'osc_theme_panel_heading');
44
45 function osc_theme_panel_content($atts, $content = null) {
46 $result = '<div class="panel-body' . EBS_CONTAINER_CLASS . '">';
47 $result .= do_shortcode($content);
48 $result .= '</div>';
49 return $result;
50 }
51
52 ebs_backward_compatibility_callback('panel-content', 'osc_theme_panel_content');
53