# easy-bootstrap-shortcodes/4.5/shortcode/badge/plugin_shortcode.php

Easy Bootstrap Shortcode, version 4.5. 27 lines.

- Page: https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/4.5/code/shortcode/badge/plugin_shortcode.php
- Raw: https://pluginprobe.com/plugins/easy-bootstrap-shortcodes/4.5/raw/shortcode/badge/plugin_shortcode.php
- Modified: 2015-09-28T11:09:44+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/4.5/code/shortcode/badge/plugin_shortcode.php#L10-L20`.

```php
<?php

/* * *********************************************************
 * Badges
 * ********************************************************* */

function osc_theme_badge($params, $content = '') {
    extract(shortcode_atts(array(
        'bgcolor' => '',
        'color' => '',
        'value' => '',
        'float_right' => '',
        'class' => ''
    ), $params));
    $out = '';
    $content = str_replace('<br class="osc" />', '', $content);
    $content = str_replace('<br class="osc" />\n', '', $content);
    $style=$bgcolor!=''?'background:'.$bgcolor.';':'';
    $style.=$color!=''?'color:'.$color.';':'';
    $style=$style!=''?' style="'.$style.'"':'';
    $float_right=$float_right=='true'?' pull-right':'';
    $out = '<span class="badge ' . $class .$float_right.EBS_CONTAINER_CLASS. '"'.$style.'>' . ($value) . '</span>';
    return $out;
}

ebs_backward_compatibility_callback('badge', 'osc_theme_badge');

```
