Exposing content
Pro
A field value appears in the REST API only when three switches all allow it.
1. The post type or taxonomy is in the REST API
On the post type's or taxonomy's REST API tab, Show in REST API must be on. It's WordPress's own switch, and the block editor needs it too, so it's usually on already. If it's off, nothing about that post type is served, VX fields included.
Users are different: they're off until you opt in specific roles (see below).
Comments need no switch of their own. A comment's fields are served on /wp/v2/comments when the comment is approved and its post is one the visitor can read, the same rule WordPress applies to the comment itself. Pending and spam comments' fields are served only to users who can edit them.
2. The fieldset's default access
Each fieldset's General tab has REST API default field access. It applies to every field in the fieldset that's set to inherit it, and it starts at Private.
3. The field's access
Each field's REST API tab has Access: Inherit from fieldset, Public, Authenticated or Private. A field's own setting always beats the fieldset default. The same tab has REST key, which publishes the value under a different name than the field key.
See Access tiers for exactly who sees what.
Exposing users
User fields are never served to anonymous visitors. To serve them at all, open VX → REST API, choose User settings (top right), and opt in the roles whose profiles apps may read. User fields are served to logged-in viewers at most, even when marked Public.
Comments
Each comment's vx object carries the fields of the fieldsets on its comment type. WordPress lists only ordinary comments by default; ask for another type with ?type=book_review. A visitor who can't edit posts can list a type only when its Show in REST API setting is on.
bash
curl "https://example.com/wp-json/wp/v2/comments?post=42&type=book_review"Check what you exposed
VX → REST API shows the result:
- Overview lists each exposed post type, taxonomy, user role and comment type as a card, with how many fields are public, authenticated-only and private.
- Preview fetches a real response as a Public visitor, an Authenticated user, or a user you choose.
Warning
When you're signed in as an administrator, you see every field, because anyone who can edit an entry can read all its fields. Always check what visitors get with Preview → Public, or a request from a logged-out browser.
What's never exposed
- Password fields, anywhere, including inside Groups and Repeaters.
- Layout fields.
- Option pages. Read those in PHP and publish what you need yourself.
- The raw meta values behind VX fields, for anyone below editor level. The
vxobject is the supported way to read them.
Technical details for LLMs
- Gates: resource (
show_in_restfor post types/taxonomies; per-role opt-in for users,vxframework/rest/user_role_exposed; for comments: not anote, approved, and the post's own resource gate passes) → fieldsetrest.expose(public|authenticated|private, defaultprivate) → fieldrest.access(inherit|public|authenticated|private, defaultinherit). - Aliases:
rest.rest_key(≤ 64) replaces the key in reads, writes and error paths. - Discovery (admin):
GET vx-framework/v1/rest/schemalists every resource's gate state and per-field{ key, rest_key, type, node, tier, serialized, writable }. The dashboard preview proxyPOST vx-framework/v1/rest/previewneedsmanage_options, allows onlyGET /wp/v2/…, and never elevates. - Settings are saved in Free (exported and imported with the fieldset) and take effect only when the Pro module is active.
- Comments:
register_rest_field( 'comment', 'vx' ); editor exemptionedit_comment; tiers apply uncapped (a public field on an approved comment reaches anonymous visitors). Writes onPOST /wp/v2/comments/<id>neededit_comment; on create, WordPress inserts the comment beforevxis written, so a refusedvxreturns an error with the comment created. VX registers no comment meta, so responses carry no fieldset meta. Discovery listsresources.comments[](one per comment type with fieldsets,endpoint…/wp/v2/comments?type=<key>).