Saltar al contenido principal

Interface: WpEmbedded

Defined in: src/types/index.ts:1592

Embedded resources returned by WordPress when _embed is used.

Contains related entities: author, featured media, terms, replies. Access with post._embedded?.["wp:featuredmedia"]?.[0].

Example

const result = await useWpGetPosts({ _embed: "author,wp:featuredmedia" });
if (result.ok) {
for (const post of result.data) {
const author = post._embedded?.author?.[0]?.name;
const image = post._embedded?.["wp:featuredmedia"]?.[0]?.source_url;
}
}

Indexable

[key: string]: unknown

Properties

author?

optional author?: object[]

Defined in: src/types/index.ts:1593

Index Signature

[key: string]: unknown

acf?

optional acf?: WpAcfFields

avatar_urls

avatar_urls: Record<string, string>

description

description: string

id

id: number

link: string

name

name: string

slug

slug: string

url

url: string


replies?

optional replies?: object[][]

Defined in: src/types/index.ts:1616


wp:featuredmedia?

optional wp:featuredmedia?: WpMedia[]

Defined in: src/types/index.ts:1604


wp:term?

optional wp:term?: object[][]

Defined in: src/types/index.ts:1605