| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
function osc_theme_popover($params, $content = 'Popover') { |
| 5 |
extract(shortcode_atts(array( |
| 6 |
'trigger' => '', |
| 7 |
'title' => '', |
| 8 |
'pop_content' => '', |
| 9 |
'style' => '', |
| 10 |
'size' => '', |
| 11 |
'type' => '' |
| 12 |
), $params)); |
| 13 |
$out = ''; |
| 14 |
$out = '<button class="osc_popover btn ' . $size . ' ' . $type . '" data-content="' . $pop_content . '" data-placement="' . $style . '" data-toggle="popover" data-trigger="'.$trigger.'" data-container="body" type="button" data-title="' . $title . '"> ' . $content . ' </button>'; |
| 15 |
|
| 16 |
|
| 17 |
$out .= " |
| 18 |
<script> |
| 19 |
jQuery(document).ready(function(){ |
| 20 |
jQuery('.osc_popover').popover(); |
| 21 |
}); |
| 22 |
</script> |
| 23 |
"; |
| 24 |
|
| 25 |
return $out; |
| 26 |
} |
| 27 |
|
| 28 |
add_shortcode('popover', 'osc_theme_popover'); |