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

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

43 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 * 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 'iconcolor'=>''
18 ), $params));
19 $out = '';
20 if($icon!=''){
21 if($iconcolor!=''){
22 $iconcolor='style="color:'.$iconcolor.';"';
23 }
24 if($align=='right'){
25 $value=$title.' <i class="glyphicon '.$icon.'" '.$iconcolor.'></i>';
26 } else{
27 $value='<i class="glyphicon '.$icon.'" '.$iconcolor.'></i> '.$title;
28 }
29 }else{
30 $value=$title;
31 }
32 $target = ' target="'.($target != 'false' ? '_blank':'_self').'"';
33 if ($type == 'link') {
34 $out = '<a class="btn ' . $style . ' ' . $class . ' '.EBS_CONTAINER_CLASS.'" href="' . $link . '" ' . ($target) . '>' . $value . '</a>';
35 } elseif ($type == 'button') {
36 $out = '<button class="btn ' . $style . ' ' . $class . ' '.EBS_CONTAINER_CLASS.'" >' . $value . '</button>';
37 }
38 return $out;
39 }
40
41 add_shortcode('button', 'osc_theme_button');
42
43