Developers

apply_filters( 'riff_protect_storage', true|WP_Error|null $done, int $id, bool $protect )

Filters whether the storage a file is kept in elsewhere was made private, when it is protected, or public again, when it isn't. A plugin that keeps uploads in object storage or on a CDN answers for its own files: true once the copy there is private (or public again), or a WP_Error to say why it couldn't be, which the Media Library shows. Without an answer, a file only on this server is moved into the protected folder, and one kept elsewhere is not protected, as moving it would leave it public there. Riff can't send a file it doesn't have, so a plugin that protects its files signs their addresses through riff_protected_url too.

Parameters

$donetrue|WP_Error|null
Null, the default: nothing keeps it elsewhere.
$idint
Attachment ID.
$protectbool
True to make it private, false to make it public again.

More Information

Usage

add_filter( 'riff_protect_storage', function ( $done, $id, $protect ) {
	return $done;
}, 10, 3 );

Source

$done = apply_filters( 'riff_protect_storage', null, $id, $protect );

Changelog

VersionDescription
5.7.0Introduced.