diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index 0f53b0a..2a897a7 100644
|
|
|
AttachmentCompat = View.extend({ |
| 2351 | 2351 | } |
| 2352 | 2352 | |
| 2353 | 2353 | _.each( this.$el.serializeArray(), function( pair ) { |
| 2354 | | data[ pair.name ] = pair.value; |
| | 2354 | // if the pair.name is greater than 2 chars and [] is the last two chars |
| | 2355 | if ( pair.name.length > 2 && '[]' === pair.name.substr( pair.name.length - 2 ) ) { |
| | 2356 | // defined item as the name minus the [] |
| | 2357 | var item = pair.name.substr( 0, pair.name.length - 2 ); |
| | 2358 | // set up list variable |
| | 2359 | var list; |
| | 2360 | // if item wasn't passed previously in data |
| | 2361 | if ( item in data ) { |
| | 2362 | // combine all of the pair.value together to one data[item] comma separated |
| | 2363 | list = data[ item ] += ',' + pair.value; |
| | 2364 | // split the list into a javascript object |
| | 2365 | data[ item ] = list.split(','); |
| | 2366 | |
| | 2367 | /* if it is the first time sending for 'item' just add once |
| | 2368 | * storing even single records as an array only for inputs |
| | 2369 | * that have name="somename[]" |
| | 2370 | */ |
| | 2371 | } else { |
| | 2372 | list = pair.value; |
| | 2373 | data[ item ] = list.split(','); |
| | 2374 | } // end if ( item in data ) |
| | 2375 | |
| | 2376 | // else if name does not end in [] |
| | 2377 | } else { |
| | 2378 | // send the value only |
| | 2379 | data[ pair.name ] = pair.value; |
| | 2380 | } |
| 2355 | 2381 | }); |
| 2356 | 2382 | |
| 2357 | 2383 | this.controller.trigger( 'attachment:compat:waiting', ['waiting'] ); |
diff --git src/wp-includes/js/media/views/attachment-compat.js src/wp-includes/js/media/views/attachment-compat.js
index a54c224..d4490e6 100644
|
|
|
AttachmentCompat = View.extend({ |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | _.each( this.$el.serializeArray(), function( pair ) { |
| 71 | | data[ pair.name ] = pair.value; |
| | 71 | // if the pair.name is greater than 2 chars and [] is the last two chars |
| | 72 | if ( pair.name.length > 2 && '[]' === pair.name.substr( pair.name.length - 2 ) ) { |
| | 73 | // defined item as the name minus the [] |
| | 74 | var item = pair.name.substr( 0, pair.name.length - 2 ); |
| | 75 | // set up list variable |
| | 76 | var list; |
| | 77 | // if item wasn't passed previously in data |
| | 78 | if ( item in data ) { |
| | 79 | // combine all of the pair.value together to one data[item] comma separated |
| | 80 | list = data[ item ] += ',' + pair.value; |
| | 81 | // split the list into a javascript object |
| | 82 | data[ item ] = list.split(','); |
| | 83 | |
| | 84 | /* if it is the first time sending for 'item' just add once |
| | 85 | * storing even single records as an array only for inputs |
| | 86 | * that have name="somename[]" |
| | 87 | */ |
| | 88 | } else { |
| | 89 | list = pair.value; |
| | 90 | data[ item ] = list.split(','); |
| | 91 | } // end if ( item in data ) |
| | 92 | |
| | 93 | // else if name does not end in [] |
| | 94 | } else { |
| | 95 | // send the value only |
| | 96 | data[ pair.name ] = pair.value; |
| | 97 | } |
| 72 | 98 | }); |
| 73 | 99 | |
| 74 | 100 | this.controller.trigger( 'attachment:compat:waiting', ['waiting'] ); |