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:
pauloiankoski 2014-03-27 20:37:00 -03:00
parent ebb6af921c
commit fd5435f7ee
1 changed files with 2 additions and 2 deletions

View File

@ -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 );
}
}
}