| @@ -1,35 +1,36 @@ | ||
| 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 | - ), $params)); | |
| 14 | - $out = ''; | |
| 15 | - if ($type == 'link') { | |
| 16 | - $out = '<a href="' . $link . '" data-placement="' . $style . '" title="' . $tooltip . '" class="osc_tooltip">' . $content . '</a> | |
| 17 | -'; | |
| 18 | - } elseif ($type == 'button') { | |
| 19 | - $out = '<button type="button" data-toggle="tooltip" data-placement="' . $style . '" title="' . $tooltip . '" class="osc_tooltip">' . $content . '</button>'; | |
| 20 | - } | |
| 21 | - | |
| 22 | - | |
| 23 | - $out .= " | |
| 24 | - <script> | |
| 25 | - jQuery(document).ready(function() { | |
| 26 | - jQuery('.osc_tooltip').tooltip(); | |
| 27 | - }); | |
| 28 | - </script> | |
| 29 | - "; | |
| 30 | - | |
| 31 | - return $out; | |
| 32 | -} | |
| 33 | - | |
| 34 | -add_shortcode('tooltip', 'osc_theme_tooltip'); | |
| 35 | - | |
| 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 | + ), $params)); | |
| 15 | + $out = ''; | |
| 16 | + if ($type == 'link') { | |
| 17 | + $out = '<a href="' . $link . '" data-placement="' . $style . '" title="' . $tooltip . '" class="osc_tooltip ' . $class . '">' . do_shortcode($content) . '</a> | |
| 18 | +'; | |
| 19 | + } elseif ($type == 'button') { | |
| 20 | + $out = '<button type="button" data-toggle="tooltip" data-placement="' . $style . '" title="' . $tooltip . '" class="btn osc_tooltip ' . $class . '">' . do_shortcode($content) . '</button>'; | |
| 21 | + } | |
| 22 | + | |
| 23 | + | |
| 24 | + $out .= " | |
| 25 | + <script> | |
| 26 | + jQuery(document).ready(function() { | |
| 27 | + jQuery('.osc_tooltip').tooltip(); | |
| 28 | + }); | |
| 29 | + </script> | |
| 30 | + "; | |
| 31 | + | |
| 32 | + return $out; | |
| 33 | +} | |
| 34 | + | |
| 35 | +add_shortcode('tooltip', 'osc_theme_tooltip'); | |
| 36 | + | |