Skip to content

How to restrict media uploads for specific user roles, except profile and cover images? #2154

@robertoduha

Description

@robertoduha

Hi there,

I’m building a BuddyPress-based site with two types of paid users: “Members” and “Users”. While both can access their profiles, messages, and groups, only “Members” should be allowed to upload media content, such as photos and videos.

However, all users (regardless of role) must still be able to upload:
– Profile pictures
– Cover images

What I need:
– Prevent specific roles (like “Users”) from accessing the ”Media” tab in their profiles
– Disable the rtMedia upload button inside messages and activity posts for those users
– Still allow the upload of profile and cover images (as BuddyPress requires)

I’ve tried some code-based role filters and CSS to hide buttons, but they either:

  1. Only hide the frontend buttons (not secure), or
  2. Block profile picture uploads entirely (which is not acceptable)

Is there a proper way to:
– Fully disable rtMedia uploads based on user role
– While keeping BuddyPress core image uploads active?

Any suggestions, filters, or add-on recommendations would be much appreciated.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions