WordPress (admin) posts search GET request filter

function getPostsByCategorySlug(slug) { return site.categories().slug( slug ) .then(function( matchingCats ) { // matchingCats will be an array of the one post that matches // the provided slug if ( ! matchingCats.length ) { throw new Error( `No category found for slug “${slug}”` ); } var catID = matchingCats[ 0 ].id; return site.posts().categories(catID); }); } getPostsByCategorySlug( … Read more