Created
July 31, 2022 16:18
-
-
Save texe/8a4e144c3f74dd10b514f465e5f4f7de to your computer and use it in GitHub Desktop.
WooCommerce - Custom tab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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