Loop over all posted attributes by referencing max posted key

Closes #8165
This commit is contained in:
Mike Jolley 2015-05-19 12:46:32 -04:00
parent ece787686d
commit a08b2e5968
2 changed files with 10 additions and 11 deletions

View File

@ -978,13 +978,12 @@ class WC_Meta_Box_Product_Data {
$attribute_variation = $_POST['attribute_variation'];
}
$attribute_is_taxonomy = $_POST['attribute_is_taxonomy'];
$attribute_position = $_POST['attribute_position'];
$attribute_names_count = sizeof( $attribute_names );
$attribute_is_taxonomy = $_POST['attribute_is_taxonomy'];
$attribute_position = $_POST['attribute_position'];
$attribute_names_max_key = max( $attribute_names );
for ( $i = 0; $i < $attribute_names_count; $i++ ) {
if ( ! $attribute_names[ $i ] ) {
for ( $i = 0; $i < $attribute_names_max_key; $i++ ) {
if ( empty( $attribute_names[ $i ] ) ) {
continue;
}

View File

@ -586,12 +586,12 @@ class WC_AJAX {
$attribute_variation = $data['attribute_variation'];
}
$attribute_is_taxonomy = $data['attribute_is_taxonomy'];
$attribute_position = $data['attribute_position'];
$attribute_names_count = sizeof( $attribute_names );
$attribute_is_taxonomy = $data['attribute_is_taxonomy'];
$attribute_position = $data['attribute_position'];
$attribute_names_max_key = max( $attribute_names );
for ( $i = 0; $i < $attribute_names_count; $i++ ) {
if ( ! $attribute_names[ $i ] ) {
for ( $i = 0; $i < $attribute_names_max_key; $i++ ) {
if ( empty( $attribute_names[ $i ] ) ) {
continue;
}