/** * Tab Shortcode Handler */ function youxi_shortcode_tab_cb($atts, $content, $tag) { $tab_id = sanitize_key($atts['title'] . Youxi_Shortcode::read_counter('tabs') . Youxi_Shortcode::read_counter($tag)); $class = 'tab-pane fade'; if (0 == Youxi_Shortcode::read_counter($tag)) { $class .= ' active in'; } $o = '<div id="' . esc_attr($tab_id) . '" class="' . esc_attr(trim($class)) . '">'; $o .= wpautop(Youxi_Shortcode_Manager::get()->shortcode_unautop(do_shortcode(wp_kses_post($content)))); $o .= '</div>'; return $o; }
/** * Slide Shortcode Handler */ function youxi_shortcode_slide_cb($atts, $content, $tag) { $o = '<div class="item' . (0 == Youxi_Shortcode::read_counter($tag) ? esc_attr(' active') : '') . '">'; $o .= '<img src="' . esc_url($atts['image']) . '" alt="' . esc_attr($atts['title']) . '">'; $o .= '<div class="carousel-caption">'; $o .= '<h3>' . esc_html($atts['title']) . '</h3>'; $o .= wpautop(wp_kses_post($content)); $o .= '</div>'; $o .= '</div>'; return $o; }