I have a template file that is being called via wp_ajax that returns data from a specific WooCommerce product.
In the "tabs" section of the template file every tab is working fine:
- Description - Good
- Additional Information - Good
- Custom Tab - Good
The only tab not rendering tab panel content is the reviews tab.
Interestingly the Tab Link (
li) shows up with the correct tab count. However, when you click the link and the review panel is no longer display:none and set as active - no content is shown. (This has been verified in dev tools).
The code that is calling all of the individual tabs is:
<?php call_user_func( $tab['callback'], $key, $tab ) ?>
$tab is an array with:
The reviews tab calls the WooCommerce specified
This is supposed to trigger the hook in
add_filter( 'comments_template', array( __CLASS__, 'comments_template_loader' ) );
In testing I've var_dumped the
WC_Template_Loader init function, and the init function, where the add_filters are located, is running.
However, when I var_dump a test string in the
comments_template_loader() function, nothing is returned.
As an aside - all other WooCommerce generated content is rendered correctly (
global $woocommerce, $post, $product are declared).
Why is this filter not running when seemingly all other default Wordpress tab filters are?