MCPcopy Create free account
hub / github.com/9d8dev/next-wp / getPostById

Function getPostById

lib/wordpress.ts:216–218  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

214}
215
216export async function getPostById(id: number): Promise<Post> {
217 return wordpressFetch<Post>(`/wp-json/wp/v2/posts/${id}`);
218}
219
220export async function getPostBySlug(slug: string): Promise<Post | undefined> {
221 const posts = await wordpressFetchGraceful<Post[]>(

Callers

nothing calls this directly

Calls 1

wordpressFetchFunction · 0.85

Tested by

no test coverage detected