API / Minn\Rest / RestUrl

RestUrl final readonly class

Minn\Rest\RestUrl · public/minn/src/Minn/Rest/RestUrl.php · 38 lines

REST URLs in the form the reference emits for the site's permalink mode: {home}/wp-json/wp/v2/... when pretty, otherwise {home}/index.php?rest_route=/wp/v2/... with the route value URL-encoded when query args ride along.

Constants and properties

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

Public

new__construct(Minn\Front\Permalinks $permalinks)#
methodhome(string $path = ''): string#

A URL under the site's home.

methodto(string $route, array $args = array ( )): string#

The URL of a REST route, pretty or plain as the site is set.

$argsarray<string, string|int>
staticcuries(): array#

The curies entry every wp/v2 _links block ends with.