jreviews:validation_rules:comment.link_video_upload
Filters validation rules when users link videos from external platforms (YouTube, Vimeo, etc.) to comments. Allows adding custom validation rules beyond the default checks.
Start here
Copy the boilerplate below, then add the logic you need. Return the modified first argument. New to hooks? Read the hooks primer first.
Fires when validating video link uploads for comments, before the video is fetched from external platform
Parameters
| Name | Type | Description |
|---|---|---|
$rules |
array |
Current validation rules array (empty by default) |
$mediable |
\JReviews\App\Models\Comment |
The comment receiving the video link |
$mediaType |
string |
The media type, always 'video' for this hook |
$request |
\FWD\Illuminate\Http\Request |
The current HTTP request |
Boilerplate
Paste this into your hook file, then add your logic and return the modified first argument.
fwd_add_filter('jreviews:validation_rules:comment.link_video_upload', function($rules, $mediable, $mediaType, $request)
{
// Your code here
return $rules;
}, 20, 4);
Why the final numbers matter:
, 20, N sets the priority and how many arguments your callback accepts. If you use both $filterResult and $listing, keep , 20, 2 so both are passed to your callback.
Source Files
app/View/Components/MediaUpload/LinkVideo.php