@wpkernel/wp-json-ast v0.12.6-beta.3
@wpkernel/wp-json-ast / ensureStorage
Function: ensureStorage()
ts
function ensureStorage(resource): object;Ensures the resource is configured with wp-post storage.
Parameters
resource
Returns
object
mode
ts
mode: "wp-post";meta?
ts
optional meta: Record<string, ResourcePostMetaDescriptor>;postType?
ts
optional postType: string;statuses?
ts
optional statuses: string[];supports?
ts
optional supports: ("title" | "editor" | "excerpt" | "custom-fields")[];taxonomies?
ts
optional taxonomies: Record<string, {
taxonomy: string;
hierarchical?: boolean;
register?: boolean;
}>;Throws
WPKernelError when storage is missing or not wp-post.
