Developers

apply_filters( 'riff_protected_send', string $how, string $file, int $id )

Filters how a protected file is handed over: 'php' sends it from PHP; 'x-sendfile' asks Apache's mod_xsendfile or LiteSpeed to send it; 'x-accel-redirect' asks Nginx, which then needs an internal location for the protected folder (see the readme).

Parameters

$howstring
'php', 'x-sendfile' or 'x-accel-redirect'. Default 'php'.
$filestring
Absolute path.
$idint
Attachment ID.

More Information

Usage

add_filter( 'riff_protected_send', function ( $how, $file, $id ) {
	return $how;
}, 10, 3 );

Source

$how = (string) apply_filters( 'riff_protected_send', 'php', $file, $id );

Changelog

VersionDescription
4.18.0Introduced.