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

Function getTagBySlug

lib/wordpress.ts:273–277  ·  view source on GitHub ↗
(slug: string)

Source from the content-addressed store, hash-verified

271}
272
273export async function getTagBySlug(slug: string): Promise<Tag> {
274 return wordpressFetch<Tag[]>("/wp-json/wp/v2/tags", { slug }).then(
275 (tags) => tags[0]
276 );
277}
278
279export async function getAllPages(): Promise<Page[]> {
280 return wordpressFetchGraceful<Page[]>("/wp-json/wp/v2/pages", [], undefined, [

Callers 1

getPostsByTagSlugFunction · 0.85

Calls 1

wordpressFetchFunction · 0.85

Tested by

no test coverage detected