public function test_autoembed_should_do_nothing_without_matching_handler()
 {
     $content = "\nhttp://example.com/embed/foo\n";
     $actual = $this->wp_embed->autoembed($content);
     $this->assertEquals($content, $actual);
 }
function hocwp_setup_theme_woocommerce_product_tabs_callback($key, $tab)
{
    $content = hocwp_get_post_meta($key, get_the_ID());
    $content = trim($content);
    $title = hocwp_get_value_by_key($tab, 'title');
    if (empty($content)) {
        $slug = hocwp_sanitize_html_class($key);
        $hocwp_product_tab = hocwp_get_post_by_slug($slug, 'hocwp_product_tab');
        if (!hocwp_is_post($hocwp_product_tab)) {
            $hocwp_product_tab = hocwp_get_post_by_column('post_title', $title);
        }
        if (hocwp_is_post($hocwp_product_tab)) {
            $content = $hocwp_product_tab->post_content;
            $content = trim($content);
        }
    }
    if (!empty($content)) {
        if (!empty($title)) {
            echo hocwp_wrap_tag($title, 'h2', 'tab-title');
        }
        echo '<div class="hocwp-product-info">';
        $embed = new WP_Embed();
        $content = $embed->run_shortcode($content);
        $content = $embed->autoembed($content);
        hocwp_the_custom_content($content);
        echo '</div>';
    }
}