'givewp', 'href' => trailingslashit(self::$baseUrl) . '{rel}', 'templated' => true, ]; return $curies; } /** * @since 4.4.0 * * To use the $response->add_link() with a custom link, you need to use a URI that is under your control, so GiveWP * uses it to generate the URL, which is transformed into givewp:$rel when generating the response by using a CURIE. * * @see https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/#adding-links-to-the-api-response * * @throws Exception */ public static function relationUrl(string $rel): string { if (wp_http_validate_url($rel)) { throw new Exception(__('The $rel value should be a unique identifier, not a full URL.', 'give')); } return trailingslashit(self::$baseUrl) . $rel; } }