| 1 |
<?php |
| 2 |
|
| 3 |
function osc_theme_panel($atts, $content = null) { |
| 4 |
extract(shortcode_atts(array( |
| 5 |
'class' => '', |
| 6 |
), $atts)); |
| 7 |
$content = str_replace("]<br />", ']', $content); |
| 8 |
|
| 9 |
$content = str_replace("<br />\n[", '[', $content); |
| 10 |
$result = '<div class="panel ' . $class . '">'; |
| 11 |
$result .= do_shortcode($content); |
| 12 |
$result .= '</div>'; |
| 13 |
|
| 14 |
return $result; |
| 15 |
} |
| 16 |
|
| 17 |
add_shortcode('panel', 'osc_theme_panel'); |
| 18 |
|
| 19 |
function osc_theme_panel_footer($atts, $content = null) { |
| 20 |
$result = '<div class="panel-footer">'; |
| 21 |
$result .= do_shortcode($content); |
| 22 |
$result .= '</div>'; |
| 23 |
return $result; |
| 24 |
} |
| 25 |
|
| 26 |
add_shortcode('panel-footer', 'osc_theme_panel_footer'); |
| 27 |
|
| 28 |
function osc_theme_panel_heading($atts, $content = null) { |
| 29 |
$result = '<div class="panel-heading">'; |
| 30 |
$result .= do_shortcode($content); |
| 31 |
$result .= '</div>'; |
| 32 |
return $result; |
| 33 |
} |
| 34 |
|
| 35 |
add_shortcode('panel-header', 'osc_theme_panel_heading'); |
| 36 |
|
| 37 |
function osc_theme_panel_content($atts, $content = null) { |
| 38 |
$result = '<div class="panel-body">'; |
| 39 |
$result .= do_shortcode($content); |
| 40 |
$result .= '</div>'; |
| 41 |
return $result; |
| 42 |
} |
| 43 |
|
| 44 |
add_shortcode('panel-content', 'osc_theme_panel_content'); |