Gets a category by the specified slug.
The getCategoryBySlug()
function returns a Promise that resolves to a category whose slug matches the specified slug.
The slug
is the end of a category's URL that refers to a specific category. For example, if a category's URL is https://example.com/blog/category/{my-category-slug}
, the slug is my-post-slug
. The slug is case-sensitive string that is generally derived from the category's label
, unless specified otherwise.
Slug of the category to retrieve.
The end of a category's URL. For example, 'https:/example.com/blog/category/{my-category-slug}'
. Case sensitive and generally based on the category label
if not specified.
Options specifying which fields to return.