Fix wpcs error and avoid unnecessary checks

This commit is contained in:
Naveen giri 2019-02-26 18:31:34 +05:30
parent f741d507ba
commit 913b8e84bf
1 changed files with 1 additions and 1 deletions

View File

@ -632,7 +632,7 @@ class WC_AJAX {
ob_start();
$attributes = $product->get_attributes( 'edit' );
$i = -1;
if( isset( $data['attribute_names'] ) && !empty( $data['attribute_names'] ) ){
if( ! 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 ) {