Bugfix/#22821: Add Fix for Warning and Notices on save attribute button click

This commit is contained in:
Naveen giri 2019-02-22 19:13:35 +05:30
parent 8f2efbfef3
commit f741d507ba
1 changed files with 14 additions and 13 deletions

View File

@ -632,7 +632,7 @@ 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 ) { foreach ( $data['attribute_names'] as $attribute_name ) {
$attribute = isset( $attributes[ sanitize_title( $attribute_name ) ] ) ? $attributes[ sanitize_title( $attribute_name ) ] : false; $attribute = isset( $attributes[ sanitize_title( $attribute_name ) ] ) ? $attributes[ sanitize_title( $attribute_name ) ] : false;
if ( ! $attribute ) { if ( ! $attribute ) {
@ -648,6 +648,7 @@ class WC_AJAX {
include( 'admin/meta-boxes/views/html-product-attribute.php' ); include( 'admin/meta-boxes/views/html-product-attribute.php' );
} }
}
$response['html'] = ob_get_clean(); $response['html'] = ob_get_clean();
} catch ( Exception $e ) { } catch ( Exception $e ) {