| 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 |
|