# easy-bootstrap-shortcodes/3.6/shortcode/buttons/plugin_shortcode.php

Easy Bootstrap Shortcode, version 3.6. 38 lines.

- Page: https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/3.6/code/shortcode/buttons/plugin_shortcode.php
- Raw: https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/3.6/raw/shortcode/buttons/plugin_shortcode.php
- Modified: 2013-09-23T14:56:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/3.6/code/shortcode/buttons/plugin_shortcode.php#L10-L20`.

```php
<?php

/* * *********************************************************
 * BUTTONS
 * ********************************************************* */

function osc_theme_button($params, $content = null) {
    extract(shortcode_atts(array(
                'title' => 'osCitas',
                'link' => '',
                'type' => 'link',
                'style' => '',
                'align' => '',
                'target' => '',
                'icon' => '',
                'class' => ''
                    ), $params));
    $out = '';
    if($icon!=''){
        if($align=='right'){
            $value=$title.' <i class="glyphicon '.$icon.'"></i>';
        } else{
            $value='<i class="glyphicon '.$icon.'"></i> '.$title;
        }
    }else{
        $value=$title;
    }
    if ($type == 'link') {
        $out = '<a class="btn ' . $style . ' ' . $class . '" href="' . $link . '" target="' . ($target) . '">' . $value . '</a>';
    } elseif ($type == 'button') {
        $out = '<button class="btn ' . $style . ' ' . $class . '" >' . $value . '</button>';
    }
    return $out;
}

add_shortcode('button', 'osc_theme_button');


```
