Example #1
0
function boston_button_func($atts, $content)
{
    extract(shortcode_atts(array('text' => '', 'link' => '', 'target' => '', 'bg_color' => '', 'bg_color_hvr' => '', 'border_radius' => '', 'icon' => '', 'font_color' => '', 'font_color_hvr' => '', 'size' => 'normal', 'align' => '', 'btn_width' => 'normal', 'inline' => 'no', 'margin' => ''), $atts));
    $rnd = boston_random_string();
    $style_css = '
	<style>
		a.' . $rnd . ', a.' . $rnd . ':active, a.' . $rnd . ':visited, a.' . $rnd . ':focus{
			display: ' . ($btn_width == 'normal' ? 'inline-block' : 'block') . ';
			' . (!empty($bg_color) ? 'background-color: ' . $bg_color . ';' : '') . '
			' . (!empty($font_color) ? 'color: ' . $font_color . ';' : '') . '
			' . (!empty($border_radius) ? 'border-radius: ' . $border_radius : '') . '
		}
		a.' . $rnd . ':hover{
			display: ' . ($btn_width == 'normal' ? 'inline-block' : 'block') . ';
			' . (!empty($bg_color_hvr) ? 'background-color: ' . $bg_color_hvr . ';' : '') . '
			' . (!empty($font_color_hvr) ? 'color: ' . $font_color_hvr . ';' : '') . '
		}		
	</style>
	';
    return boston_shortcode_style($style_css) . '
	<div class="btn-wrap" style="margin: ' . esc_attr($margin) . '; text-align: ' . $align . '; ' . ($inline == 'yes' ? 'display: inline-block;' : '') . ' ' . ($inline == 'yes' && $align == 'right' ? 'float: right;' : '') . '">
		<a href="' . esc_url($link) . '" class="btn btn-default ' . $size . ' ' . $rnd . ' ' . ($link != '#' && $link[0] == '#' ? 'slideTo' : '') . '" target="' . esc_attr($target) . '">
			' . ($icon != 'No Icon' && $icon != '' ? '<i class="fa fa-' . $icon . ' ' . (empty($text) ? 'no-margin' : '') . '"></i>' : '') . '
			' . $text . '
		</a>
	</div>';
}
Example #2
0
function boston_alert_func($atts, $content)
{
    extract(shortcode_atts(array('text' => '', 'border_color' => '', 'bg_color' => '', 'font_color' => '', 'icon' => '', 'closeable' => 'no', 'close_icon_color' => '', 'close_icon_color_hvr' => ''), $atts));
    $rnd = boston_random_string();
    $style_css = '
		<style>
			.' . $rnd . '.alert .close{
				color: ' . $close_icon_color . ';
			}
			.' . $rnd . '.alert .close:hover{
				color: ' . $close_icon_color_hvr . ';
			}
		</style>
	';
    return boston_shortcode_style($style_css) . '
	<div class="alert ' . $rnd . ' alert-default ' . ($closeable == 'yes' ? 'alert-dismissible' : '') . '" role="alert" style=" color: ' . $font_color . '; border-color: ' . $border_color . '; background-color: ' . $bg_color . ';">
		' . (!empty($icon) && $icon !== 'No Icon' ? '<i class="fa fa-' . $icon . '"></i>' : '') . '
		' . $text . '
		' . ($closeable == 'yes' ? '<button type="button" class="close" data-dismiss="alert"> <span aria-hidden="true">×</span> <span class="sr-only">' . __('Close', 'boston') . '</span> </button>' : '') . '
	</div>';
}
function boston_progressbar_func($atts, $content)
{
    extract(shortcode_atts(array('label' => '', 'value' => '', 'color' => '', 'bgcolor' => '', 'label_color' => '', 'height' => '', 'font_size' => '', 'icon' => '', 'border_radius' => '', 'style' => ''), $atts));
    $rnd = boston_random_string();
    $style_css = '
	<style>
		.' . $rnd . '{
			' . (!empty($label_color) ? 'color: ' . $label_color . ';' : '') . '
			' . (!empty($border_radius) ? 'border-radius: ' . $border_radius . ';' : '') . '
			' . (!empty($height) ? 'height: ' . $height . ';' : '') . '
			' . (!empty($bgcolor) ? 'background-color: ' . $bgcolor . ';' : '') . '
		}

		.' . $rnd . ' .progress-bar{
			' . (!empty($font_size) ? 'font-size: ' . $font_size . ';' : '') . '
			' . (!empty($height) ? 'line-height: ' . $height . ';' : '') . '
			' . (!empty($color) ? 'background-color: ' . $color . ';' : '') . '
		}

		.' . $rnd . ' .progress-bar-value{
			' . (!empty($color) ? 'background-color: ' . $color . ';' : '') . '
			' . (!empty($label_color) ? 'color: ' . $label_color . ';' : '') . '
		}

		.' . $rnd . ' .progress-bar-value:after{
			' . (!empty($color) ? 'border-color: ' . $color . ' transparent;' : '') . '
		}
	</style>
	';
    return boston_shortcode_style($style_css) . '
	<div class="progress ' . $rnd . '">
	  <div class="progress-bar ' . $style . '" style="width: ' . esc_attr($value) . '%" role="progressbar" aria-valuenow="' . $value . '" aria-valuemin="0" aria-valuemax="100">
	  		<div class="progress-bar-value">' . $value . '%</div>
	  		' . (!empty($icon) ? '<i class="fa fa-' . $icon . '"></i>' : '') . '' . $label . '
	  </div>
	</div>';
}