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?
optionalauthor?:object[]
Defined in: src/types/index.ts:1593
Index Signature
[key: string]: unknown
acf?
optionalacf?:WpAcfFields
avatar_urls
avatar_urls:
Record<string,string>
description
description:
string
id
id:
number
link
link:
string
name
name:
string
slug
slug:
string
url
url:
string
replies?
optionalreplies?:object[][]
Defined in: src/types/index.ts:1616
wp:featuredmedia?
optionalwp:featuredmedia?:WpMedia[]
Defined in: src/types/index.ts:1604
wp:term?
optionalwp:term?:object[][]
Defined in: src/types/index.ts:1605