WordPress.org

Ready to get started?Download WordPress

Forums

bbPress Enable TinyMCE Visual Tab
[resolved] Allow subscribers to upload media? (2 posts)

  1. DJScorpion
    Member
    Posted 2 months ago #

    Do you think it's a bad idea to grant subscribers the right to upload media?
    Mostly they would need it for images (in my case). Oh and I disabled the WP admin for them :)

    Here's the code for the functions.php

    add_action('admin_init', 'allow_subscriber_uploads');
    function allow_subscriber_uploads() {
        $subscriber = get_role('subscriber');
        $subscriber->add_cap('upload_files');
    }
    
    add_action('admin_init', 'no_mo_dashboard');
    function no_mo_dashboard() {
      if (!current_user_can('manage_options') && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') {
      wp_redirect(home_url()); exit;
      }
    }

    https://wordpress.org/plugins/bbpress-enable-tinymce-visual-tab/

  2. Jared Atchison
    Member
    Plugin Author

    Posted 2 months ago #

    There are two big issues, with doing that and why we haven't added media uploading to bbPress core (yet).

    First is restricting what kind of media they can upload, how big, etc. For example most likely you only want your subscribers to upload jpg/jpeg/gif (image) files and you likely want those to be < 500kb.

    Second, the other issue, if I recall, I ran into when I looked into this was there needs to be a way to filter the media in shown in the Media Gallery.

    For example you don't want the subscriber to see files uploaded by other subscribers, or worse, by the administrators. It should either show them no uploaded files or only there own.

    So until those 2 issues are solved, I won't be recommending or enabling uploads for subscribers. With that said, it's definitely something I would like to do, I just haven't had time to research the solutions we need.

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic