diff --git a/src/wp-includes/js/wp-api.js b/src/wp-includes/js/wp-api.js index a14d21fae6..717ebf8e06 100644 --- a/src/wp-includes/js/wp-api.js +++ b/src/wp-includes/js/wp-api.js @@ -1234,7 +1234,9 @@ }, // Specify the model that this collection contains. - model: loadingObjects.models[ modelClassName ], + model: function( attrs, options ) { + return new loadingObjects.models[ modelClassName ]( attrs, options ); + }, // Include a reference to the original class name. name: collectionClassName, @@ -1257,7 +1259,9 @@ url: routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) + routeName, // Specify the model that this collection contains. - model: loadingObjects.models[ modelClassName ], + model: function( attrs, options ) { + return new loadingObjects.models[ modelClassName ]( attrs, options ); + }, // Include a reference to the original class name. name: collectionClassName,