Gerne möchte man die Begriffe der Reiter der Produkt-Tabs und die Reihenfolge ändern. Dies ist wirklich sinnvoll um klare Begriffe zu verwenden und zu ordnen. Auch hier gibt es das kleine Code-Snippet zum Einfügen. Vorteil hierbei ist, das wir kein Plugin benötigen.
Reihenfolge der Tabs festlegen:
add_filter( 'woocommerce_product_tabs', 'wpb_reorder_tabs', 98 );
function wpb_reorder_tabs( $tabs ) {
$tabs['reviews']['priority'] = 5; // Reviews first
$tabs[test_tab]['priority'] = 10; // Commission second
$tabs['description']['priority'] = 15; // Description third
$tabs['additional_information']['priority'] = 20; // Additional information fourth
return $tabs;
}
und das Ändern der Reiter- bzw. Tabnamen:
add_filter( 'woocommerce_product_tabs', 'wpb_rename_tabs', 98 );
function wpb_rename_tabs( $tabs ) {
$tabs['description']['title'] = __( 'More Information', 'text-domain' );// Rename the description tab
$tabs['reviews']['title'] = __( 'Ratings', 'text-domain' ); // Rename the reviews tab
$tabs['additional_information']['title'] = __( 'Product Data', 'text-domain' ); // Rename the additional information tab
$tabs['test_tab']['title'] = __( 'Commission', 'text-domain' ); // Rename the discount tab
return $tabs;
}
WordPress - Creative Publisher
