woocommerce_new_product_variation_data
Usage
add_filter( 'woocommerce_new_product_variation_data', 'wp_kama_woocommerce_new_product_variation_data_filter' ); /** * Function for `woocommerce_new_product_variation_data` filter-hook. * * @param $array * * @return */ function wp_kama_woocommerce_new_product_variation_data_filter( $array ){ // filter... return $array; }
- $array
- -
Where the hook is called
woocommerce_new_product_variation_data
woocommerce/includes/data-stores/class-wc-product-variation-data-store-cpt.php 146-163
apply_filters( 'woocommerce_new_product_variation_data', array( 'post_type' => 'product_variation', 'post_status' => $product->get_status() ? $product->get_status() : 'publish', 'post_author' => get_current_user_id(), 'post_title' => $product->get_name( 'edit' ), 'post_excerpt' => $product->get_attribute_summary( 'edit' ), 'post_content' => '', 'post_parent' => $product->get_parent_id(), 'comment_status' => 'closed', 'ping_status' => 'closed', 'menu_order' => $product->get_menu_order(), 'post_date' => gmdate( 'Y-m-d H:i:s', $product->get_date_created( 'edit' )->getOffsetTimestamp() ), 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', $product->get_date_created( 'edit' )->getTimestamp() ), 'post_name' => $product->get_slug( 'edit' ), ) ),