Bugfix/#22821: Add Fix for Warning and Notices on save attribute button click
This commit is contained in:
parent
8f2efbfef3
commit
f741d507ba
|
@ -632,21 +632,22 @@ class WC_AJAX {
|
||||||
ob_start();
|
ob_start();
|
||||||
$attributes = $product->get_attributes( 'edit' );
|
$attributes = $product->get_attributes( 'edit' );
|
||||||
$i = -1;
|
$i = -1;
|
||||||
|
if( isset( $data['attribute_names'] ) && !empty( $data['attribute_names'] ) ){
|
||||||
|
foreach ( $data['attribute_names'] as $attribute_name ) {
|
||||||
|
$attribute = isset( $attributes[ sanitize_title( $attribute_name ) ] ) ? $attributes[ sanitize_title( $attribute_name ) ] : false;
|
||||||
|
if ( ! $attribute ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
$metabox_class = array();
|
||||||
|
|
||||||
foreach ( $data['attribute_names'] as $attribute_name ) {
|
if ( $attribute->is_taxonomy() ) {
|
||||||
$attribute = isset( $attributes[ sanitize_title( $attribute_name ) ] ) ? $attributes[ sanitize_title( $attribute_name ) ] : false;
|
$metabox_class[] = 'taxonomy';
|
||||||
if ( ! $attribute ) {
|
$metabox_class[] = $attribute->get_name();
|
||||||
continue;
|
}
|
||||||
|
|
||||||
|
include( 'admin/meta-boxes/views/html-product-attribute.php' );
|
||||||
}
|
}
|
||||||
$i++;
|
|
||||||
$metabox_class = array();
|
|
||||||
|
|
||||||
if ( $attribute->is_taxonomy() ) {
|
|
||||||
$metabox_class[] = 'taxonomy';
|
|
||||||
$metabox_class[] = $attribute->get_name();
|
|
||||||
}
|
|
||||||
|
|
||||||
include( 'admin/meta-boxes/views/html-product-attribute.php' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$response['html'] = ob_get_clean();
|
$response['html'] = ob_get_clean();
|
||||||
|
|
Loading…
Reference in New Issue