WordPress filter hook
product_type_options
Fired by 6 WordPress plugins, running on 7M+ sites between them.
How to use product_type_options
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'product_type_options', function( $base_type_options ) {
// Change $base_type_options here.
return $base_type_options;
}, 10, 1 );Argument names come from WC Vendors's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
6 plugins that fire product_type_options
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'product_type_options', wc_get_default_product_type_options() )includes/admin/meta-boxes/class-wc-meta-box-product-data.php:63 -
RY Tools for WooCommerce4,000+ installs
apply_filters( 'product_type_options', wc_get_default_product_type_options() )woocommerce/admin/product.php:41 -
WC Vendors3,000+ installs
apply_filters( 'product_type_options', $base_type_options )classes/front/forms/class-wcv-product-form.php:694 -
BrikPanel: WooCommerce Dashboard & Analytics, Abandoned Cart Recovery, Order Export, Inventory Management & Bulk Editor1,000+ installs
apply_filters( 'product_type_options', $defaults )front-end/products/brikpanel-product-editor.php:7849 -
BuddyForms Form Elements for WooCommerce10+ installs
apply_filters( 'product_type_options', array( 'virtual' => array( 'id' => '_virtual', 'wrapper_class' => 'show_if_simple', 'label' => __( 'Virtual', 'buddyforms-woocommerce-form-elements' ), 'description' => '<b>' . __( 'Virtual products are intangible and aren\'t shipped.', 'buddyforms-woocommerce-form-elements' ) . '</b>', 'default' => 'no', ), 'downloadable' => array( 'id' => '_downloadable', 'wrapper_class' => 'show_if_simple', ... )includes/bf_woo_elem_form_builder.php:153 -
Invoice management for WoocommerceFewer than 10 installs
apply_filters( 'product_type_options', array( 'virtual' => array( 'id' => '_virtual', 'wrapper_class' => 'show_if_simple', 'label' => __( 'Virtual', 'woocommerce' ), 'description' => __( 'Virtual products are intangible and are not shipped.', 'woocommerce' ), 'default' => 'no', ), 'downloadable' => array( 'id' => '_downloadable', 'wrapper_class' => 'show_if_simple', 'label' => __( 'Downloadable', 'woocommerce' ), 'description' => __... )admin/meta-boxes/class-wc-meta-box-product-data.php:56
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.