function _fixItemsCollections( collection, c ) {
					if ( typeof collection.cid != 'undefined' ) {
						// it's a model, the second param is the collection
						collection = c;
					}

					collection.each( function ( item ) {
						item.collection = collection;

						item.collection.off( null, _fixItemsCollections );
						item.collection.on( 'reset add', _fixItemsCollections );

						/**
						 * Sometimes item.get('_items') is empty at this point, wait a few milliseconds
						 * Bad solution, I home BackboneRelation will be fixed and this code will be removed
						 */
						setTimeout( _.bind( function () {
							_fixItemsCollections( this.get( '_items' ) );
						}, item ), 0 );
					} );
				}
/**
			 * Something happened in WP 4.5 (or backbone.relational compatibility with latest backbone)
			 * and items restored from input doesn't have the .collection property
			 * and it's impossible to remove them from builder (console errors).
			 * So loop recursive and fix item.collection
			 */
Something happened in WP 4.5 (or backbone.relational compatibility with latest backbone)
and items restored from input doesn't have the .collection property
and it's impossible to remove them from builder (console errors).
So loop recursive and fix item.collection
Something happened in WP 4 . 5 ( or backbone . relational compatibility with latest backbone ) and items restored from input doesn ' t have the . collection property and it ' s impossible to remove them from builder ( console errors ) . So loop recursive and fix item . collection
function _fixItemsCollections( collection, c ) {
					if ( typeof collection.cid != 'undefined' ) {
						collection = c;
					}
					collection.each( function ( item ) {
						item.collection = collection;
						item.collection.off( null, _fixItemsCollections );
						item.collection.on( 'reset add', _fixItemsCollections );
						setTimeout( _.bind( function () {
							_fixItemsCollections( this.get( '_items' ) );
						}, item ), 0 );
					} );
				}
function _fixItemsCollections ( collection , c ) { if ( typeof collection . cid != 'undefined' ) { collection = c ; } collection . each ( function ( item ) { item . collection = collection ; item . collection . off ( null , _fixItemsCollections ) ; item . collection . on ( 'reset add' , _fixItemsCollections ) ; setTimeout ( _ . bind ( function ( ) { _fixItemsCollections ( this . get ( '_items' ) ) ; } , item ) , 0 ) ; } ) ; }
Something happened in WP 4.5 (or backbone.relational compatibility with latest backbone)
 and items restored from input doesn't have the .collection property
 and it's impossible to remove them from builder (console errors).
Something happened in WP 4 . 5 ( or backbone . relational compatibility with latest backbone ) and items restored from input doesn ' t have the . collection property and it ' s impossible to remove them from builder ( console errors ) .
// it's a model, the second param is the collection /**
						 * Sometimes item.get('_items') is empty at this point, wait a few milliseconds
						 * Bad solution, I home BackboneRelation will be fixed and this code will be removed
						 */