# easy-bootstrap-shortcodes/2.5/shortcode/oscpopover/plugin_shortcode.php

Easy Bootstrap Shortcode, version 2.5. 38 lines.

- Page: https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/2.5/code/shortcode/oscpopover/plugin_shortcode.php
- Raw: https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/2.5/raw/shortcode/oscpopover/plugin_shortcode.php
- Modified: 2014-03-03T07:33:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/2.5/code/shortcode/oscpopover/plugin_shortcode.php#L10-L20`.

```php
<?php

function osc_theme_popover($params, $content = 'Popover') {
    extract(shortcode_atts(array(
        'trigger' => '',
        'title' => '',
        'pop_content' => '',
        'style' => '',
        'size' => '',
        'type' => '',
        'class' => ''
    ), $params));
    $out = '';
    $out = '<button class="osc_popover btn ' . $size . ' ' . $type . ' ' . $class .EBS_CONTAINER_CLASS. '" data-content="' . $pop_content . '" data-placement="' . $style . '" data-toggle="popover" data-trigger="' . $trigger . '" data-container="body" type="button" data-title="' . $title . '"> ' . do_shortcode($content) . ' </button>';

if(EBS_POPOVER_TEMPLATE==''){
    $out .= "
    <script>
       jQuery(document).ready(function(){
        jQuery('.osc_popover').popover();
        });
    </script>
    ";


} else{
    $out .= "
    <script>
       jQuery(document).ready(function(){
        jQuery('.osc_popover').popover({template:'".EBS_POPOVER_TEMPLATE."'});
        });
    </script>
    ";
}
    return $out;
}

add_shortcode('popover', 'osc_theme_popover');
```
