Remove batch support declaration from block patterns REST, fix navigation areas #39834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Followup to #39185 that removes batch support declaration from the block patterns and categories REST endpoints. They both support only
GET
, and batching is relevant only for write methods likePOST
.I'm also fixing batch support declaration for the
/wp/v2/block-navigation-areas
endpoints (originally added by @anton-vlasenko in #36374). The/block-navigation-areas
endpoint is only readable and doesn't need the declaration. But the/block-navigation-areas/{id}
endpoint is writable and doesn't declare batch support. So I moved the declaration to the right place.How to test:
Before this patch, a batch request like:
would fail with a
rest_batch_not_allowed
error. After this patch, it fails withrest_navigation_area_invalid
which is better: the batch is performed, and it's the1
id that's deemed invalid.