easy-svg-pro/create-share-link
Create a share link.
Ability, Easy SVG Pro, defined in includes/abilities/manage.php
Usage
wp_get_ability( 'easy-svg-pro/create-share-link' )->execute( array $input ): array|WP_Error
Example
<?php
$ability = wp_get_ability( 'easy-svg-pro/create-share-link' );
if ( $ability ) {
$result = $ability->execute( array(
'collection' => 'brand',
'hours' => 24,
) );
}
Description
Makes a secret link that hands one collection to another site until it expires. The url is in this answer once and nowhere afterwards. The license and author of the collection travel with the pack.
Runs through the plugin's own REST handler, so its permission check, argument schema and handler do the work. The ability adds no write path of its own.
Registered while the AI agents (MCP) switch and the Share links feature are on.
Permission: the user needs manage_options and an active license, and every call asks the route's own check again.
Writes to the site.
Only collections the export screen offers can be shared, the same list list-pack-collections returns. An unknown collection is refused with easy_svg_pro_share_refused (404), a lifetime other than 1, 24 or 168 hours with 400. A site holds at most 50 live links; the 51st is refused with 409 until one is revoked or expires.
Parameters
Required. The collection slug to share.
Optional. How long the link works, in hours. One of: 1, 24, 168. Defaults to 24.
Return value
An array on success, a WP_Error with the route's code and status on failure. It holds url, the link to hand to the other site, id, the link's id for revoke-share-link, and the same links and hours as list-share-links. The url is only in this answer: this site keeps a hash of its secret, so nothing can show it again.