Abilitieseasy-svg-pro/revoke-share-link

easy-svg-pro/revoke-share-link

Revoke a share link.

Ability, Easy SVG Pro, defined in includes/abilities/manage.php

Usage

wp_get_ability( 'easy-svg-pro/revoke-share-link' )->execute( array $input ): array|WP_Error

Example

<?php
$ability = wp_get_ability( 'easy-svg-pro/revoke-share-link' );
if ( $ability ) {
	$result = $ability->execute( array(
		'id' => '3f9a1c0b7d42',
	) );
}

Description

Ends one share link at once, by the id list-share-links gives.

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.

Destructive: it overwrites or removes what is there. Read first, preview where a preview exists. Calling it twice with the same input has the same effect as once.

From then on the link answers with the same 404 as an expired or unknown one. An id that is not stored is refused with easy_svg_pro_share_unknown (404).

Parameters

body
idstring

Required. The link to revoke: its id, 12 lower case hex characters (^[a-f0-9]{12}$), as list-share-links and create-share-link return it. Not the url.

Return value

returnarray|WP_Error

An array on success, a WP_Error with the route's code and status on failure. On success the same links and hours as list-share-links, without the revoked link.