You are here

function bs_shortcodes_column in Bootstrap 3 shortcodes 7

bs_shortcodes_column

@author Simon Yeldon @since 1.0 @todo pull and offset

File

./bs_shortcodes.module, line 636

Code

function bs_shortcodes_column($attrs, $content = '') {
  extract(shortcode_attrs(array(
    "lg" => false,
    "md" => false,
    "sm" => false,
    "xs" => false,
    "offset_lg" => false,
    "offset_md" => false,
    "offset_sm" => false,
    "offset_xs" => false,
    "pull_lg" => false,
    "pull_md" => false,
    "pull_sm" => false,
    "pull_xs" => false,
    "push_lg" => false,
    "push_md" => false,
    "push_sm" => false,
    "push_xs" => false,
    "xclass" => false,
    "data" => false,
  ), $attrs));
  $class = '';
  $class .= $lg ? ' col-lg-' . $lg : '';
  $class .= $md ? ' col-md-' . $md : '';
  $class .= $sm ? ' col-sm-' . $sm : '';
  $class .= $xs ? ' col-xs-' . $xs : '';
  $class .= $offset_lg || $offset_lg === 0 ? ' col-lg-offset-' . $offset_lg : '';
  $class .= $offset_md || $offset_md === 0 ? ' col-md-offset-' . $offset_md : '';
  $class .= $offset_sm || $offset_sm === 0 ? ' col-sm-offset-' . $offset_sm : '';
  $class .= $offset_xs || $offset_xs === 0 ? ' col-xs-offset-' . $offset_xs : '';
  $class .= $pull_lg || $pull_lg === 0 ? ' col-lg-pull-' . $pull_lg : '';
  $class .= $pull_md || $pull_md === 0 ? ' col-md-pull-' . $pull_md : '';
  $class .= $pull_sm || $pull_sm === 0 ? ' col-sm-pull-' . $pull_sm : '';
  $class .= $pull_xs || $pull_xs === 0 ? ' col-xs-pull-' . $pull_xs : '';
  $class .= $push_lg || $push_lg === 0 ? ' col-lg-push-' . $push_lg : '';
  $class .= $push_md || $push_md === 0 ? ' col-md-push-' . $push_md : '';
  $class .= $push_sm || $push_sm === 0 ? ' col-sm-push-' . $push_sm : '';
  $class .= $push_xs || $push_xs === 0 ? ' col-xs-push-' . $push_xs : '';
  $class .= $xclass ? ' ' . $xclass : '';
  $data_props = _bs_shortcodes_parse_data_attributes($data);
  return sprintf('<div class="%s"%s>%s</div>', check_plain($class), $data_props ? ' ' . $data_props : '', $content);
}