function thb_slideshow() { // $config = thb_config('core/slideshows'); $page_id = thb_get_page_ID(); $slideshow_shortcode = thb_get_post_meta($page_id, 'slideshow'); if (empty($slideshow_shortcode)) { return; } if (thb_text_contains($slideshow_shortcode, 'thb_')) { $slideshow_id = thb_get_shortcode_attribute($slideshow_shortcode, 'id'); $thb_slideshow = new THB_Slideshow($slideshow_id); $slideshow_type = $thb_slideshow->getType(); if (thb_is_page_template(thb_config('core/slideshows/submodules/' . $slideshow_type, 'templates'))) { if (!empty($slideshow_shortcode) && trim($slideshow_shortcode) != '') { echo thb_do_shortcode($slideshow_shortcode); } } } else { echo thb_do_shortcode($slideshow_shortcode); } }
/** * Constructor * * @param string $name The field name. * @param string $template The field template. **/ public function __construct($name, $template) { $this->_name = $name; $this->_template = $template; if (thb_text_contains('/', $this->_template)) { $this->_specificTemplatePath = true; } $this->reset(); }
function thb_get_css_rule($rule, $value, $prefix = '', $suffix = '') { if ($value !== '') { if ($rule == 'font-family') { $value = str_replace('+', ' ', $value); } elseif ($rule == 'text-variant') { $font_style = thb_text_contains('italic', $value) ? 'italic' : 'normal'; $font_weight = str_replace('italic', '', $value); if (thb_text_contains('regular', $font_weight) || empty($font_weight)) { $font_weight = 'normal'; } return thb_get_css_rule('font-weight', $font_weight) . ' ' . thb_get_css_rule('font-style', $font_style); } return $rule . ': ' . $prefix . $value . $suffix . ';'; } return ''; }