• Alright, so after all morning of searching how to modify WordPress to allow contributor to upload media I found nothing and decided to open some source files. I’m just posting my results here for the world to see.

    1) Open wp-admin/includes/dashboard.php – comment out 349 and 353
    2) Open wp-admin/media-upload.php – comment out 15-16
    3) Open wp-includes/general-tamplate.php – comment out 1508 and 1512 (on 1508 be sure to leave the closing ?> to end the php statement on 1511.

    That’s it (at least, I think that’s it). Hope this helps someone out there. Leave a quick post if it does. I’m just curious.

Viewing 15 replies - 1 through 15 (of 16 total)
  • I tried this little tutorial and it did NOT work.

    Thanks for the effort, I couldent find anything on this either.

    I am just trying to get it so authors can upload images and other media. I am surprised this hasent been covered yet.

    Thread Starter smplejohn

    (@smplejohn)

    It may not have worked b/c I did this for contributors, not authors. I think authors could already upload… may be wrong though.

    Actually, it is pretty simple. You will be able to accomplish the following:
    1. Hide the Dashboard from the subscribers view. Only thing visible to subscribers will be their profile.
    2. Enable File Upload functionality for Contributers. Your contributors will be able to upload images
    3. Hide the dashboard and tools and media menu for all contributers. Your contributers will be able to upload images but will not be able to view or delete any other images.

    Here we go:
    You need 2 plugins to do this for you. First you need to get the Role Manager plugin and enable “Upload Files” for the contributer level. Then get the WP-Hide Dashboard plugin from https://www.kpdesign.net/wp-plugins/wp-hide-dashboard/, which will hide the dashboard for all subscribers. Most probably you don’t want your contributors to see the Dashboard or Tools or the Media menu. Media menu includes the upload functionality but it is quiet easy to hide. You just have to edit the wp-hidedashboard.php file. Here is an excerpt from the author:

    How do I change this to hide the dashboard and tools menu and help options from other roles besides Subscriber?

    To hide these from other roles, you will need to edit the plugin in a plain text editor and make the following changes:

    Subscriber → Contributor:
    Change !current_user_can(‘edit_posts’) to !current_user_can(‘upload_files’)
    Subscriber → Author:
    Change !current_user_can(‘edit_posts’) to !current_user_can(‘create_users’)
    Subscriber → Editor:
    Change !current_user_can(‘edit_posts’) to !current_user_can(‘manage_options’)
    There are 3 instances of this code in the plugin – make sure you change all of them.

    Now, to disable the Media menu which includes the upload options. Search for unset($menu[75]); in wp-hidedashboard.php file and Add unset($menu[10]); after it.

    Save and upload and thats it. Now your subscriber or your contributor

    Anyone have links to sites doing this? Would love to see it in action.

    hello holyinsomniac great to know i can disable the Media Menu..

    now.. i want the go further..
    what is the number for the comments menu and the latest WP Contact Form 7 ? (i want to exclude them in my wp hide dashbiard plugin)

    until now i have the following numbers:

    unset($menu[0]); Hides Dashboard menu
    unset($menu[4]); Hides arrow separator under Dashboard link in 2.7+
    unset($menu[10]); Hides media
    unset($menu[55]); Hides Tools menu in 2.7 and 2.7.1
    unset($menu[75]); Hides Tools menu in 2.8

    where can i find a list of wordpress admin menu’s and their corresponding numbers?

    thanks

    Bongo

    (@jbudisantoso)

    @leeroi: If you open the file on your site wp-admin/menu.php you can take a look at all the menu numbers there. It’s not commented much, but taking a look at the code it won’t be to hard to figure out what’s what.

    @leeroi: I’m the WP Hide Dashboard plugin author. Read this comment for the plugin on my site – it has the code corrections that need to be made in order to accomplish what you want.

    @holyinsomniac

    It would be nice to combine these two plugins (WP Hide Dashboard + Role Manager) but according to the comments in the plugin’s page, the Role Manager is buggy for 2.8 and is not being actively maintained by Thomas, the author. So that’s not an alternative anymore.

    What’s the best alternative to still allow contributors to upload media (even while not allowing them to manage media) – which is the whole idea of this support topic?

    Cheers!

    @dreamyguy: Justin Tadlock just released this plugin today: Members

    From the description:

    Members is a plugin that extends your control over your blog. It’s a user, role, and content management plugin that was created to make WordPress a more powerful CMS.

    You should be able to tweak the contributors’ capabilities to allow them to upload media.

    Hi kpdesign,
    thanks for this MEMBER plugin tip!
    Making private pages is a piece of cake now!

    I do have 1 question tough: I want to make a detail (not private) page, called ‘appelmans’, which should be updated by one user only (with specific role).
    So I made the capability ‘edit_appelmans_page’. But it doesn’t work. Only if a select also capability ‘edit_other_pages’. But ofcours, this makes all the pages editable.

    Do you have any suggestions..?
    thank you very much,
    diederik

    @ballyhoo: You would need to contact Justin Tadlock regarding the Members plugin (he is the author) regarding your question.

    Merci kpdesign!

    He offers also the possibility to become ‘exclusive member’ (25$/year), but it looks like this is only about the Hybrid themes. I poped the question if I can find help concerning the Members Plugin too.
    And I am now waiting for his response..

    diederik

    @ballyhoo: I’m a member of ThemeHybrid forum and yes, there is a section where Justin provides support for his WordPress plugins, including the Members plugin.

    When you are interested using the members plugin by Justin Tadlock for a CMS, and want to know more about the possibilities with pages.

    QUESTION:
    ‘How can you restrict by role, which pages a user can post to?
    I’m creating a site where there will be 4 users, each will have a specific page to edit, and each can only see their specific pages in the backend.

    ANSWER you get as a pying exclisive member (25$) from Justin Tadlock:

    > You can’t do that with the Members plugin.

    Members is great, thanks for the referral.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Allow contributor to upload media’ is closed to new replies.