Apply filters to $product_type
Apply filters to $product_type and we can set a default product type to new products.
This commit is contained in:
parent
ebb6af921c
commit
fd5435f7ee
|
@ -30,7 +30,7 @@ class WC_Meta_Box_Product_Data {
|
|||
if ( $terms = wp_get_object_terms( $post->ID, 'product_type' ) )
|
||||
$product_type = sanitize_title( current( $terms )->name );
|
||||
else
|
||||
$product_type = 'simple';
|
||||
$product_type = apply_filters( 'default_product_type', 'simple' );
|
||||
|
||||
$product_type_selector = apply_filters( 'product_type_selector', array(
|
||||
'simple' => __( 'Simple product', 'woocommerce' ),
|
||||
|
@ -1523,4 +1523,4 @@ class WC_Meta_Box_Product_Data {
|
|||
|
||||
update_post_meta( $post_id, '_default_attributes', $default_attributes );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue