Das Snippet fügt ein allgemeines Produkt-Tab in WooCommerce hinzu.
In das neue Produkt-Tab kannst du Informationen hinterlegten, die dann in allen Produktbeschreibungen erscheinen.
/*
* WooCommerce - Neues Produkt-Tab hinzufügen
* https://wooexperte.de/snippet/neues-produkt-tab-hinzufuegen/
*/
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
// Inhalt Produkt-Tab
$tabs['test_tab'] = array(
'title' => __( 'Neues Produkt Tab', 'woocommerce' ), // Beschriftung Tab
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);
return $tabs;
}
function woo_new_product_tab_content() {
// Inhalt Produkt Tab
echo '<h2>Überschrift Produkt-Tab</h2>'; // Überschrift Tab
echo '<p>Text Produkt-Tab</p>'; // Text Tab
}