wp-content/plugins/gasket/gasket.php
Gasket
Expose custom fields in the REST API with a schema, which is the part everyone skips.
== Description ==
Registering meta for REST is four arguments and a permission callback, and most code gets two of them right. A field without a schema is untyped, unvalidated and invisible to any client that reads the API description โ which is every generated client and the block editor itself.
Gasket generates the registration from a description of the field: type, whether it is an array, whether it is single, who can read it, who can write it. The output is a plain register_post_meta() call you can export and commit.
It validates that existing meta matches its declared schema and reports the rows that do not, which is usually how you discover a field has held three different shapes since 2019.
== Screenshots ==
Numbered the way they ship in /assets/. Click any one to see it full width.
== Installation ==
- Install and activate the plugin.
- Describe your fields under Tools โ Gasket, or point it at a config file.
- Run the validation report before you rely on the schema.
Export produces PHP with no dependency on Gasket, so the plugin is removable once you are done.
== Frequently asked questions ==
Does it work with term and user meta?
All three: post, term and user meta, with the same schema treatment.
What about protected keys?
Keys beginning with an underscore need an explicit auth callback, and Gasket makes you write one rather than defaulting to permissive.
== Changelog ==
= 1.8.1 =
- Fixed: array-typed fields registered with a single item schema, so multi-value meta failed validation on read.
= 1.8.0 =
- Validation report comparing stored meta against declared schemas.
= 1.5.0 =
- Term and user meta support.