Filters the folder protected files are kept in, so the web server never has them to send: an absolute path outside the web root, which Riff makes when it is first needed, keeping each site's files in a folder of its own inside it (the site's ID on a network). Empty, the default, keeps them in a folder under uploads, which Apache is told to refuse and Nginx needs a rule for.
Parameters
$pathstring- Absolute path, or empty for the folder under uploads.
More Information
A path inside ABSPATH, wp-content, uploads, or the folder that holds both WordPress and wp-content, is refused with a notice, and the files stay under uploads; WP Engine's _wpeprivate folder at the site's root, which WP Engine never serves, is the one exception. When the path changes, Riff moves the files already protected to the new folder in the background, or at once with wp riff protected move. Defaults to the RIFF_PROTECTED_PATH constant.
Usage
add_filter( 'riff_protected_path', function ( $path ) {
return $path;
} );Source
$base = trim( (string) apply_filters( 'riff_protected_path', $base ) );plugins/riff/src/class-protected-files.phpView on GitHub
Changelog
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |