Skip to content

Instantly share code, notes, and snippets.

@corsonr
Created October 17, 2013 07:39
Show Gist options
  • Save corsonr/7020691 to your computer and use it in GitHub Desktop.
Save corsonr/7020691 to your computer and use it in GitHub Desktop.
Mastering WooCommerce Products Custom Fields 13
add_action( 'woocommerce_product_write_panel_tabs', 'woo_add_custom_admin_product_tab' );
function woo_add_custom_admin_product_tab() {
?>
<li class="custom_tab"><a href="#custom_tab_data"><?php _e('My Custom Tab', 'woocommerce'); ?></a></li>
<?php
}
@michaelmcmillan
Copy link

That's perfect! How would I add fields to this custom tab? I know how to add custom fields to the "general" tab:

add_action('woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields');

But what should I replace woocommerce_product_options_general_product_data with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment