-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
Description
Issue Description
As of WordPress 5.9 there are new options for the format
param including text
and textarea
.
These are important for string types because without specifying a format, strings do not get sanitized properly.
URL of the Page with the Issue
https://developer.wordpress.org/rest-api/extending-the-rest-api/schema
Section of Page with the issue
- https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/#format
- https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/#changelog
Why is this a problem?
When utilizing the REST API with json schema, it is really handy to know the format options that help with sanitization, particularly for string fields.
Suggested Fix
Changelog
https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/#changelog
We should add 5.9
WordPress 5.9
- Support the
text-field
andtextarea-field
formats.
In this section

we should add:
text-field
a text fieldtextarea-field
a textarea field
It would also be good to mention how by adding these formats it will also take care of sanitization.