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

Function getPostsByTag

lib/wordpress.ts:254–256  ·  view source on GitHub ↗
(tagId: number)

Source from the content-addressed store, hash-verified

252}
253
254export async function getPostsByTag(tagId: number): Promise<Post[]> {
255 return wordpressFetch<Post[]>("/wp-json/wp/v2/posts", { tags: tagId });
256}
257
258export async function getTagsByPost(postId: number): Promise<Tag[]> {
259 return wordpressFetch<Tag[]>("/wp-json/wp/v2/tags", { post: postId });

Callers

nothing calls this directly

Calls 1

wordpressFetchFunction · 0.85

Tested by

no test coverage detected