PluginProbe
Easy Bootstrap Shortcode / 4.4
Easy Bootstrap Shortcode v4.4
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 4.4, at shortcode/buttons/plugin_shortcode.php

48 lines 1.6 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 'linkrel' => '',
12 'type' => 'link',
13 'style' => '',
14 'align' => '',
15 'target' => '',
16 'icon' => '',
17 'class' => '',
18 'iconcolor'=>''
19 ), $params));
20 $out = '';
21 $iconcount = array();
22 if ($icon) $iconcount=explode(' ',$icon);
23 array_filter($iconcount);
24 if(count($iconcount)==1){
25 $icon= 'glyphicon '.$icon;
26 }
27 if($icon!=''){
28 if($iconcolor!=''){
29 $iconcolor='style="color:'.$iconcolor.';"';
30 }
31 if($align=='right'){
32 $value=$title.' <i class="'.$icon.'" '.$iconcolor.'></i>';
33 } else{
34 $value='<i class="'.$icon.'" '.$iconcolor.'></i> '.$title;
35 }
36 }else{
37 $value=$title;
38 }
39 $target = ' target="'.($target != 'false' ? '_blank':'_self').'"';
40 if ($type == 'link') {
41 $out = '<a class="btn ' . $style . ' ' . $class . ' '.EBS_CONTAINER_CLASS.'" href="' . $link . '" rel="' . $linkrel . '" ' . ($target) . '>' . $value . '</a>';
42 } elseif ($type == 'button') {
43 $out = '<button class="btn ' . $style . ' ' . $class . ' '.EBS_CONTAINER_CLASS.'" >' . $value . '</button>';
44 }
45 return $out;
46 }
47
48 ebs_backward_compatibility_callback('button', 'osc_theme_button');