function ts_column_shortcode($atts, $content = null) { global $ts_within_column; $atts = shortcode_atts(array('size' => 'one-third', 'last' => 'no'), $atts); $_size = $atts['size']; $size = preg_replace("/[^0-9a-z]*/", "", $atts['size']); if (ts_essentials_starts_with('onehalf', $size)) { $size = 'one-half'; } elseif (ts_essentials_starts_with('onethird', $size)) { $size = 'one-third'; } elseif (ts_essentials_starts_with('onefourth', $size)) { $size = 'one-fourth'; } elseif (ts_essentials_starts_with('onefifth', $size)) { $size = 'one-fifth'; } elseif (ts_essentials_starts_with('onesixth', $size)) { $size = 'one-sixth'; } elseif (ts_essentials_starts_with('twothird', $size)) { $size = 'two-third'; } elseif (ts_essentials_starts_with('threefourth', $size)) { $size = 'three-fourth'; } elseif (ts_essentials_starts_with('twofifth', $size)) { $size = 'two-fifth'; } elseif (ts_essentials_starts_with('threefifth', $size)) { $size = 'three-fifth'; } elseif (ts_essentials_starts_with('fourfifth', $size)) { $size = 'four-fifth'; } elseif (ts_essentials_starts_with('fivesixth', $size)) { $size = 'five-sixth'; } $size = $ts_within_column === true ? 'boxed-' . $size : $size; if (isset($atts['last']) && $atts['last'] == 'yes' && $ts_within_column !== true) { return '<div class="ts-' . esc_attr($size) . ' ts-column-last">' . do_shortcode($content) . '</div><div class="clear"></div>'; } else { return '<div class="ts-' . esc_attr($size) . '">' . do_shortcode($content) . '</div>'; } }
function ts_essentials_fontawesome_class($icon, $default = '') { $icon = trim($icon) ? trim($icon) : $default; if (ts_starts_with($icon, 'fa-')) { $icon = substr($icon, 3); } elseif (ts_essentials_starts_with($icon, 'icon-')) { $icon = substr($icon, 5); } return trim($icon) ? esc_attr('fa fa-' . $icon) : ''; }