WpEmbedded
katanakit-js / WpEmbedded
Type Alias: WpEmbedded
Section titled “Type Alias: WpEmbedded”type WpEmbedded = z.infer<typeof WpEmbeddedSchema>;Defined in: types/adapters/wordpress.ts:183
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
Section titled “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; }}