Skip to main content

Interface: PostOrPostsParams

@headstartwp/core.PostOrPostsParams

The params supported by PostOrPostsFetchStrategy

Hierarchy

Properties

_embed

Optional _embed: boolean

The _embed param returned associated entities in the response

It's recommended to avoid additional requests to fetch data

Inherited from

EndpointParams._embed

Defined in

packages/core/src/data/strategies/AbstractFetchStrategy.ts:17


_fields

Optional _fields: string[]

The _fields parameter is used to return only the specified fields in the response

Inherited from

EndpointParams._fields

Defined in

packages/core/src/data/strategies/AbstractFetchStrategy.ts:22


archive

archive: Partial<PostsArchiveParams>

The archive params corresponds to PostsArchiveParams

Defined in

packages/core/src/data/strategies/PostOrPostsFetchStrategy.ts:25


lang

Optional lang: string

The polylang ?lang parameter.

This is only used if the polylang integration is enabled

Inherited from

EndpointParams.lang

Defined in

packages/core/src/data/strategies/AbstractFetchStrategy.ts:29


priority

priority: "archive" | "single"

The priority indicates which strategy should execute first.

Defined in

packages/core/src/data/strategies/PostOrPostsFetchStrategy.ts:30


routeMatchStrategy

routeMatchStrategy: "none" | "archive" | "single" | "both"

How to handle route matching strategy, the possible values are:

  • single will only trigger the single strategy if there's a url match for the single strategy
  • archive will only trigger the archive strategy if there's a url match for the archive strategy
  • both requires a route match for both single and archive

Defined in

packages/core/src/data/strategies/PostOrPostsFetchStrategy.ts:39


single

single: Partial<PostParams>

The single params corresponds to PostParams

Defined in

packages/core/src/data/strategies/PostOrPostsFetchStrategy.ts:20