| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
JSON Schema API: shared functions for working with JSON Schema.
| File Size: | 72 lines (2 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| wp_get_json_schema_allowed_keywords( string $schema_profile = 'rest-api' ) X-Ref |
| Gets the JSON Schema keywords allowed for a given schema profile. Use the returned list to decide which keywords to keep when a schema is output as JSON. Both profiles describe JSON Schema draft-04 output, also called JSON Schema Version 4. They differ only in how much of the keyword vocabulary stays in the result. - 'rest-api' returns the subset of draft-04 that the WordPress REST API uses for route output. This is the default. - 'draft-04' returns the larger draft-04 set used when publishing a schema as a standalone document to clients, such as the Abilities API. It keeps documentation and passthrough keywords like '$ref', 'definitions', 'allOf', 'not', 'dependencies', and 'additionalItems'. The keywords are allowed to stay in the schema output. This does not mean WordPress validates or sanitizes values against them. param: string $schema_profile Optional. Name of the schema profile to get keywords for. return: string[] Allowed JSON Schema keywords. |
| Generated : Wed Jun 24 08:20:11 2026 | Cross-referenced by PHPXref |