Set $variation object when add variation via ajax
When the variation-admin-html.php template is loaded on the Edit Product screen, $variation is a WP_Post Object. When the template is loaded by woocommerce_add_variation() handling an Ajax call, $variation is an array. This commit makes $variation consistent so functions hooking to 'woocommerce_product_after_variable_attributes' and 'woocommerce_variation_options' receive the same variable type regardless of what initiated the template loading.
This commit is contained in:
parent
22376b8d73
commit
e2c50cd529
|
@ -655,6 +655,7 @@ function woocommerce_add_variation() {
|
|||
|
||||
$_tax_class = '';
|
||||
$image_id = 0;
|
||||
$variation = get_post( $variation_id ); // Get the variation object
|
||||
|
||||
include( 'admin/post-types/writepanels/variation-admin-html.php' );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue