Skip to content

Commit

Permalink
Pattern Creator: Remove media API override
Browse files Browse the repository at this point in the history
We're not using the core media library anymore, so we don't need to do this override.
  • Loading branch information
ryelle committed Dec 2, 2021
1 parent fa01587 commit eaddc5b
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
// Use a middleware provider to intercept and modify API calls.
// Short-circuit POST requests, bound queries, allow media, etc.
export default function ( options, next ) {
// Add limits to all GET queries which attempt unbound queries
if ( options.path ) {
// Add limits to all GET queries which attempt unbound queries
options.path = options.path.replace( 'per_page=-1', 'per_page=50' );

// Load images with the view context, seems to work
if ( 0 === options.path.indexOf( '/wp/v2/media' ) ) {
options.path = options.path.replace( 'context=edit', 'context=view' );
}
}

return next( options );
Expand Down

0 comments on commit eaddc5b

Please sign in to comment.