Skip to content

Instantly share code, notes, and snippets.

@texe
Created July 31, 2022 16:18
Show Gist options
  • Save texe/8a4e144c3f74dd10b514f465e5f4f7de to your computer and use it in GitHub Desktop.
Save texe/8a4e144c3f74dd10b514f465e5f4f7de to your computer and use it in GitHub Desktop.
WooCommerce - Custom tab
/**
* Custom tab
*/
add_filter( 'woocommerce_product_tabs', 'ct_custom_tab' );
function ct_custom_tab( $tabs ) {
// Adds the new tab
$tabs['test_tab'] = array(
'title' => __( 'Custom Tab', 'woocommerce' ),
'priority' => 50,
'callback' => 'ct_custom_tab_content'
);
return $tabs;
}
function ct_custom_tab_content() {
// The new tab content
echo '<h3>My Custom Tab</h3>';
echo '<p>Here\'s your new product tab!</p>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment