PluginProbe
Easy Bootstrap Shortcode / 4.5
Easy Bootstrap Shortcode v4.5
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 / tooltip / plugin_shortcode.php

plugin_shortcode.php in Easy Bootstrap Shortcode 4.5, at shortcode/tooltip/plugin_shortcode.php

47 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /* * *********************************************************
4 * Tooltip
5 * ********************************************************* */
6
7 function osc_theme_tooltip($params, $content = 'Tooltip') {
8 extract(shortcode_atts(array(
9 'type' => '',
10 'link' => '',
11 'tooltip' => '',
12 'style' => '',
13 'class' => '',
14 'target' => '',
15 ), $params));
16 $out = '';
17 if ($type == 'link') {
18 $out = '<a href="' . $link . '" data-placement="' . $style . '" title="' . $tooltip . '" class="osc_tooltip ' . $class .'" target="'.$target.'">' . do_shortcode($content) . '</a>
19 ';
20 } elseif ($type == 'button') {
21 $out = '<button type="button" data-toggle="tooltip" data-placement="' . $style . '" title="' . $tooltip . '" class="btn osc_tooltip ' . $class . '">' . do_shortcode($content) . '</button>';
22 }
23
24 if(EBS_TOOLTIP_TEMPLATE==''){
25 $out .= "
26 <script>
27 jQuery(document).ready(function() {
28 jQuery('.osc_tooltip').tooltip();
29 });
30 </script>
31 ";
32
33 } else{
34 $out .= "
35 <script>
36 jQuery(document).ready(function(){
37 jQuery('.osc_tooltip').tooltip({template:'".EBS_TOOLTIP_TEMPLATE."'});
38 });
39 </script>
40 ";
41 }
42
43
44 return $out;
45 }
46
47 ebs_backward_compatibility_callback('tooltip', 'osc_theme_tooltip');