Skip to content

Inserted Page won't appear in a custom tab on WooCommerce single product page #62

@cdatwood

Description

@cdatwood

I have a Woocommerce store, and I am using a plugin from XForWoocommerce that provides the ability to create custom tabs and fill them with content. The short code is correct and works on other pages, and inside the two provided tabs by Woocommerce.

I've tried hooking into the filter, as well as forcing all tabs to manually execute do_shortcode, but none of it seems to work. I wanted to see if you had any insights into what I might be able to do to work around it. Your solution is perfect for my frequently asked questions and customer support areas — why maintain it separately in 3-4 places?

Test URL: https://staging.burlybottomdesigns.com/shop/apparel/tees/short-sleeve-tee-goodness/

On this page, the first tab only has the short code. I have also tried routing this through WPCode, in case it rendered differently, but it did not. My reviews plugin IS rendering in the tabs, so I don't think it's related to short codes being disabled in the custom tab.

Here are some of the things I tried in my functions.php file —

//Force custom tabs to show shortcodes

add_filter('xforwoocommerce_product_tabs_content', function($content) {
	return do_shortcode($content);
});

----------------------------------

add_filter('woocommerce_product_tabs', function($tabs) {
	foreach ($tabs as $key => $tab) {
		if(!empty($tab['content'])) {
			
			$tabs[$key]['content'] = do_shortcode($tab['content']);
		}
	}
	
	return $tabs;
});
Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions