Preview
fabrement-previewA tokenized URL to see what you built, opened in your browser without a wp-admin session — the MANDATORY check after every save. target "content": a page/post/CPT record (drafts included) on its own address through its template. target "template": the whole assembled template (header, content slot, footer) on one record (contentId), a sample of a type (postType) or an archive (context). target "block": one block alone, optionally rendered ON a record (contentId) so it sees that record's fields. Private and password-protected records are never shown. Rules: get-skill-doc {id:"preview-contract"} — read it before the first call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The record id (content), template id (template) or block id (block). | |
| target | Yes | What to preview: a record, a template or a block. | |
| context | No | template only: an ARCHIVE view — "archive:<postType>", "blog-home", "tax", "tax:<taxonomy>" or "tax:<taxonomy>:<termId>" (list-archives). | |
| postType | No | template only, without contentId: the type whose latest published record is the sample. Omitted: a type the template is the default for, else page. | |
| contentId | No | template / block: the record to show them ON (published or draft, never private). A template previews that record's page; a block renders as if placed there, so fabrement_get_field() and get_queried_object_id() see it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| status | No | content / contentId: the record's status (publish, draft…). | |
| expiresIn | Yes | Seconds the URL stays valid. |