JReviews logo Docs
Menu
Version

can_upload_listing_media

Filter user permission to upload media to listings by specifying the allowed media types.

Filter
Listing Permissions

You need to have a working knowledge of Hooks before you get started.

To disable upload permissions, return an empty array. Individual media type permissions can also be controlled using the hooks available for each media type.

Parameters

Name Type Description
$allowedMediaTypes parameter (array) ['attachment', 'audio', 'photo', 'video']
$params parameter (array) associative array with contextual data

Boilerplate Code

Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.

Clickfwd\Hook\Filter::add('can_upload_listing_media', function($allowedMediaTypes, $params)
{
    // Uncomment line below to view available data passed into hook
    // fwd_dd($allowedMediaTypes, $params);

    return $allowedMediaTypes;
});
Development & Support
Customizations are not included with support. We provide this information to make it easier for developers to extend the functionality. From time to time we may have some availability for custom work. Get in touch to see if there's an opportunity to work together.

Source Files

  • /services/authorization/listing_permissions.php