Example #1
0
 public function col_shortcode($atts, $content = '')
 {
     extract(shortcode_atts(array('id' => '', 'class' => '', 'offset_xs' => '', 'offset' => '', 'offset_md' => '', 'offset_lg' => '', 'width_xs' => '', 'width' => '', 'width_md' => '', 'width_lg' => '', 'hide_xs' => '', 'hide' => '', 'hide_md' => '', 'hide_lg' => '', 'push_xs' => '', 'push' => '', 'push_md' => '', 'push_lg' => '', 'pull_xs' => '', 'pull' => '', 'pull_md' => '', 'pull_lg' => ''), $atts));
     $class = MMTL_Common::html_class_to_array($class);
     $my_class = array();
     if ($offset_xs) {
         $my_class[] = 'mmtl-col-xs-offset-' . MMTL_Common::get_column_width_codes($offset_xs, 'array=0');
     }
     if ($offset) {
         $my_class[] = 'mmtl-col-sm-offset-' . MMTL_Common::get_column_width_codes($offset, 'array=0');
     }
     if ($offset_md) {
         $my_class[] = 'mmtl-col-md-offset-' . MMTL_Common::get_column_width_codes($offset_md, 'array=0');
     }
     if ($offset_lg) {
         $my_class[] = 'mmtl-col-lg-offset-' . MMTL_Common::get_column_width_codes($offset_lg, 'array=0');
     }
     if ($width_xs) {
         $my_class[] = 'mmtl-col-xs-' . MMTL_Common::get_column_width_codes($width_xs, 'array=0');
     }
     if ($width) {
         $my_class[] = 'mmtl-col-sm-' . MMTL_Common::get_column_width_codes($width, 'array=0');
     }
     if ($width_md) {
         $my_class[] = 'mmtl-col-md-' . MMTL_Common::get_column_width_codes($width_md, 'array=0');
     }
     if ($width_lg) {
         $my_class[] = 'mmtl-col-lg-' . MMTL_Common::get_column_width_codes($width_lg, 'array=0');
     }
     if ($hide_xs) {
         $my_class[] = 'mmtl-hidden-xs';
     }
     if ($hide) {
         $my_class[] = 'mmtl-hidden-sm';
     }
     if ($hide_md) {
         $my_class[] = 'mmtl-hidden-md';
     }
     if ($hide_lg) {
         $my_class[] = 'mmtl-hidden-lg';
     }
     if ($push_xs) {
         $my_class[] = 'mmtl-col-xs-push-' . MMTL_Common::get_column_width_codes($push_xs, 'array=0');
     }
     if ($push) {
         $my_class[] = 'mmtl-col-sm-push-' . MMTL_Common::get_column_width_codes($push, 'array=0');
     }
     if ($push_md) {
         $my_class[] = 'mmtl-col-md-push-' . MMTL_Common::get_column_width_codes($push_md, 'array=0');
     }
     if ($push_lg) {
         $my_class[] = 'mmtl-col-lg-push-' . MMTL_Common::get_column_width_codes($push_lg, 'array=0');
     }
     if ($pull_xs) {
         $my_class[] = 'mmtl-col-xs-pull-' . MMTL_Common::get_column_width_codes($pull_xs, 'array=0');
     }
     if ($pull) {
         $my_class[] = 'mmtl-col-sm-pull-' . MMTL_Common::get_column_width_codes($pull, 'array=0');
     }
     if ($pull_md) {
         $my_class[] = 'mmtl-col-md-pull-' . MMTL_Common::get_column_width_codes($pull_md, 'array=0');
     }
     if ($pull_lg) {
         $my_class[] = 'mmtl-col-lg-pull-' . MMTL_Common::get_column_width_codes($pull_lg, 'array=0');
     }
     $str = '';
     $str .= sprintf('<div%s>', MMTL_Common::parse_html_attributes(array('id' => $id ? $id . '-wrap' : '', 'class' => array_merge(array('mmtl-col'), $my_class, MMTL_Common::format($class, '%s-wrap')))));
     $str .= sprintf('<div%s>%s</div>', MMTL_Common::parse_html_attributes(array('id' => $id, 'class' => array_merge(array('mmtl-content'), $class))), do_shortcode($content));
     $str .= '</div>';
     return $str;
 }