PluginProbe
Easy Bootstrap Shortcode / 3.7
Easy Bootstrap Shortcode v3.7
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 / buttons / plugin_shortcode.php

plugin_shortcode.php in Easy Bootstrap Shortcode 3.7, at shortcode/buttons/plugin_shortcode.php

39 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /* * *********************************************************
4 * BUTTONS
5 * ********************************************************* */
6
7 function osc_theme_button($params, $content = null) {
8 extract(shortcode_atts(array(
9 'title' => 'osCitas',
10 'link' => '',
11 'type' => 'link',
12 'style' => '',
13 'align' => '',
14 'target' => '',
15 'icon' => '',
16 'class' => ''
17 ), $params));
18 $out = '';
19 if($icon!=''){
20 if($align=='right'){
21 $value=$title.' <i class="glyphicon '.$icon.'"></i>';
22 } else{
23 $value='<i class="glyphicon '.$icon.'"></i> '.$title;
24 }
25 }else{
26 $value=$title;
27 }
28 $target = ' target="'.($target != 'false' ? '_blank':'_self').'"';
29 if ($type == 'link') {
30 $out = '<a class="btn ' . $style . ' ' . $class . '" href="' . $link . '" ' . ($target) . '>' . $value . '</a>';
31 } elseif ($type == 'button') {
32 $out = '<button class="btn ' . $style . ' ' . $class . '" >' . $value . '</button>';
33 }
34 return $out;
35 }
36
37 add_shortcode('button', 'osc_theme_button');
38
39