Filters whether the current visitor may play a track.
Parameters
$allowedbool- Whether the track plays. Default true.
$trackarray- Track, after riff_track.
$attachment_idint- Attachment ID, or 0 for a file outside the Media Library.
$post_idint- The post the track appears in, or 0.
More Information
A membership or store plugin returns false for a track its rules keep from this visitor. The track is then listed as locked rather than hidden, with no file to play.
Usage
add_filter( 'riff_can_play', function ( $allowed, $track, $attachment_id, $post_id ) {
return $allowed;
}, 10, 4 );Source
if ( (bool) apply_filters( 'riff_can_play', true, $track, $attachment_id, $post_id ) ) {plugins/riff/src/class-tracks.phpView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.17.0 | Introduced. |