I have created a custom tab for a single product and would like to know with the code below if there is a way to specify a certain page to act as the content for that tab?
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$tabs['test_tab'] = array(
'title' => __( 'Seller Disclosure', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);
return $tabs;
}
function woo_new_product_tab_content() {
// The new tab content
echo '<h2>Coming Soon</h2>';
}
This is possible calling a classic WordPress post content for a defined post ID (page) this way:
Code goes in any php file of your active child theme (or theme) or also in any plugin php file.
This code Is tested and works.