{"id":1697,"date":"2024-09-26T13:44:49","date_gmt":"2024-09-26T13:44:49","guid":{"rendered":"http:\/\/docs"},"modified":"2024-09-26T13:44:49","modified_gmt":"2024-09-26T13:44:49","password":"","slug":"support-of-the-custom-product-tabs-for-woocommerce-yikes-inc","status":"publish","type":"docs","link":"https:\/\/www.8theme.com\/documentation\/xstore\/additional-customisation\/support-of-the-custom-product-tabs-for-woocommerce-yikes-inc\/","title":{"rendered":"Support of the Custom Product Tabs for WooCommerce (YIKES, Inc.)"},"content":{"rendered":"<p>To make the theme compatible with the <a href=\"https:\/\/wordpress.org\/plugins\/yikes-inc-easy-custom-woocommerce-product-tabs\/\" target=\"_blank\" rel=\"noopener\">Custom Product Tabs for WooCommerce<\/a> plugin add the following code in child theme <code class=\"inline-code\">functions.php<\/code> file:<\/p>\n<pre>add_filter(&#39;etheme_single_product_builder_tabs&#39;, &#39;etheme_single_product_builder_tabs_yikes_custom&#39;);\n\nfunction etheme_single_product_builder_tabs_yikes_custom($tabs) {\n    if (!class_exists(&#39;YIKES_Custom_Product_Tabs_Display&#39;)) {\n        return $tabs;\n    }\n    global $product;\n\n    $product_id = method_exists( $product, &#39;get_id&#39; ) === true ? $product-&gt;get_id() : $product-&gt;ID;\n\n    $product_tabs = maybe_unserialize( get_post_meta( $product_id, &#39;yikes_woo_products_tabs&#39; , true ) );\n\n    if ( ! empty( $product_tabs ) ) {\n\n        \/\/ Setup priorty to loop over, and render tabs in proper order\n        $i = 60; \n\n        foreach ( $product_tabs as $tab ) {\n\n            \/\/ Do not show tabs with empty titles on the front end\n            if ( empty( $tab[&#39;title&#39;] ) ) {\n                continue;\n            }\n\n            $tab_key = $tab[&#39;id&#39;]; \n\n            $tabs[ $tab_key ] = array(\n                &#39;title&#39;     =&gt; $tab[&#39;title&#39;],\n                &#39;priority&#39;  =&gt; $i++,\n                &#39;callback&#39;  =&gt; &#39;custom_product_tabs_panel_content_yikes&#39;,\n                &#39;content&#39;   =&gt; $tab[&#39;content&#39;]\n            );\n        }\n    }\n\n    \/**\n    * Filter: &#39;yikes_woo_filter_all_product_tabs&#39;\n    *\n    * Generic filter that passes all of the tab info and the corresponding product. Cheers.\n    *\n    * Note: This passes all of the tabs for the current product, not just the Custom Product Tabs created by this plugin.\n    *\n    * @param array  | $tab      | Array of $tab data arrays.\n    * @param object | $product  | The WooCommerce product these tabs are for\n    *\/\n    $tabs = apply_filters( &#39;yikes_woo_filter_all_product_tabs&#39;, $tabs, $product );\n\n    return $tabs;\n}\n\nfunction custom_product_tabs_panel_content_yikes( $key, $tab ) {\n\n    $content = &#39;&#39;;          \n\n    $use_the_content_filter = apply_filters( &#39;yikes_woo_use_the_content_filter&#39;, true );\n\n    if ( $use_the_content_filter === true ) {\n        $content = apply_filters( &#39;the_content&#39;, $tab[&#39;content&#39;] );\n    } else {\n        $content = apply_filters( &#39;yikes_woo_filter_main_tab_content&#39;, $tab[&#39;content&#39;] );\n    }\n\n    $tab_title_html = &#39;&lt;h2 class=&quot;yikes-custom-woo-tab-title yikes-custom-woo-tab-title-&#39; . urldecode( sanitize_title( $tab[&#39;title&#39;] ) ) . &#39;&quot;&gt;&#39; . $tab[&#39;title&#39;] . &#39;&lt;\/h2&gt;&#39;;\n    echo apply_filters( &#39;yikes_woocommerce_custom_repeatable_product_tabs_heading&#39;, $tab_title_html, $tab );\n    echo apply_filters( &#39;yikes_woocommerce_custom_repeatable_product_tabs_content&#39;, $content, $tab );\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To make the theme compatible with the Custom Product Tabs for WooCommerce plugin add the following code in child theme functions.php file: add_filter(&#39;etheme_single_product_builder_tabs&#39;, &#39;etheme_single_product_builder_tabs_yikes_custom&#39;); function etheme_single_product_builder_tabs_yikes_custom($tabs) { if (!class_exists(&#39;YIKES_Custom_Product_Tabs_Display&#39;)) { return $tabs; } global $product; $product_id = method_exists( $product, &#39;get_id&#39; ) === true ? $product-&gt;get_id() : $product-&gt;ID; $product_tabs = maybe_unserialize( get_post_meta( $product_id, &#39;yikes_woo_products_tabs&#39; , true [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"doc_category":[42],"doc_tag":[],"class_list":["post-1697","docs","type-docs","status-publish","hentry","doc_category-additional-customisation"],"aioseo_notices":[],"year_month":"2026-04","word_count":319,"total_views":"3550","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"author_nicename":"docs","author_url":"https:\/\/www.8theme.com\/documentation\/author\/docs\/"},"doc_category_info":[{"term_name":"Additional Customization","term_url":"https:\/\/www.8theme.com\/documentation\/xstore\/additional-customisation\/"}],"doc_tag_info":[],"author_list":[{"ID":"1","user_login":"docs","display_name":"docs","id":"1"}],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/docs\/1697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/comments?post=1697"}],"version-history":[{"count":0,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/docs\/1697\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/media?parent=1697"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=1697"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.8theme.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=1697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}