WordPress.org

Ready to get started?Download WordPress

Forums

Hide Some Media Upload Buttons/Functions (16 posts)

  1. justbishop
    Member
    Posted 4 years ago #

    I'm full of questions lately, I know :p

    I'd like users to be shown the upload IMAGE icon, but none of the others. Can't find where I can get rid of the 3 other little icons there. Anyone know?

    Also, I'd like to make it so that users cannot browse through the media library to look at photos other users have uploaded. I'm using Adminimize for other purposes, so the Media Library link in the sidebar is hidden, but when a user uploads a photo from the add/edit post page, there's a "media library" tab available to them there in the popup. I'd like to either get rid of that tab completely, or make it so that when in th media library, they are only shown photos that they've uploaded themselves. If there's a plugin for this, that would begrat, buI can mess with code given some coaching :)

  2. justbishop
    Member
    Posted 4 years ago #

    Nevermind, I'm just going to have users call their photo remotely using a custom field instead and just hide the entire upload feature using Adminimize.

    I'm not marking this as resolved for a reason. Maybe someone will eventually come by with a solution for anyone else who might search on the same issue.

  3. Dalton
    Member
    Posted 4 years ago #

    The way I did it is to create a custom CSS file like this:

    a#add_image.thickbox, a#add_video.thickbox, a#add_audio.thickbox, a#add_media.thickbox { display: none; }

    Then put this in your functions.php to load the CSS when you're on an admin page:

    if( is_admin()){
       wp_register_style('custom_admin', ("http://path/to/admin.css"), false, '1', 'screen');
       wp_enqueue_style('custom_admin');
    }

    I'm sure there are other ways to do this, but it works for me!

  4. iambean
    Member
    Posted 4 years ago #

    Hi. I am looking to do the exact same thing and was wondering if you ever found a way to get this to work?

    Daltonrooney, I tried your method but it is hiding all of the upload buttons. I think what Justbishop and I are trying to do is hide or remove the "Media Library" link that comes up in the pop up when you are selecting a file to upload. I couldn't see where in your code to get rid of that.

    "I'd like to make it so that users cannot browse through the media library to look at photos other users have uploaded. I'm using Adminimize for other purposes, so the Media Library link in the sidebar is hidden, but when a user uploads a photo from the add/edit post page, there's a "media library" tab available to them there in the popup. I'd like to either get rid of that tab completely, or make it so that when in the media library, they are only shown photos that they've uploaded themselves."

    Can someone please please help with this?

  5. coolakul
    Member
    Posted 4 years ago #

    I am looking for the same thing as posted above - can someone please help

  6. fvl2000
    Member
    Posted 3 years ago #

    Hi. No pluggable functions can do that (WP3.0) You need to hack
    wp-admin/includes/media.php
    wp-admin/edit-attachements-row.php

    I've created a quick post for that on
    http://blog.mondayinthesun.com.au/2010/09/wp-hide-photos-uploaded-by-other-in.html

    Hope this help.

  7. superann
    Member
    Posted 3 years ago #

    Here's a way to remove the Media Library tab completely without hacks:

    http://superann.com/2010/10/08/how-to-remove-the-media-library-tab-in-the-wordpress-media-uploader/

  8. fvl2000
    Member
    Posted 3 years ago #

    @superann I can't make it work :/
    I'm using this one with WP3.01 without any problem:

    function rm_upld() {
    return;
    }
    
    add_filter('media_upload_tabs', 'rm_upld', 1, 2);
  9. superann
    Member
    Posted 3 years ago #

    @fvl2000 That's interesting... it looks like that filter function you provided might remove all the tabs, but if it's working for you then that's cool. I'm not sure why my filter function doesn't work for you as all I'm doing there is unsetting the Media Library tab specifically. However I'm only doing it for people who can't edit others' posts (ie. anyone at or below the author level).

  10. consumedesign
    Member
    Posted 3 years ago #

    Thanks for the link above superann! I have been looking for a way to remove the lib and url tabs from the media upload area for a while now.

    function remove_medialibrary_tab($tabs) {
    unset($tabs['type_url']);
    unset($tabs['library']);
    return $tabs;
    }
    add_filter('media_upload_tabs','remove_medialibrary_tab');

  11. Adrian
    Member
    Posted 3 years ago #

    @consumedesign @superann

    Is there anyway of utilizing @consumedesign's function to remove the gallery tab... I tried changing ['library'] to ['gallery'] but that doesn't seem to work.

    I want to remove the gallery tab as I often use the NextGen plug-in, which makes the gallery tab redundant and it just confuses clients it being there.

    Any help much appreciated!!!

  12. asafche
    Member
    Posted 3 years ago #

    do you mean that you want to remove the "gallery tab" produced by NextGen?
    you probably need to hack the NextGen plugin and look for the
    add_filter('media_upload_tabs','...');

    did i understood you correctly?

  13. Adrian
    Member
    Posted 3 years ago #

    @asafche No, the other way around... I want to keep the NextGen tab, but remove WordPress' default gallery tab from the Media "pop-up" panel. @consumedesign's hack works for the Library and URL tabs, but not for the gallery tab. Any suggestions most appreciated!

  14. asafche
    Member
    Posted 3 years ago #

    The "gallery tab" isn't a default tab of the media uploader.
    it probably comes from another plugin in your WP...

    the default tabs of WordPress are "From Computer", "From URL" & "Media Library", in that order.

    asafche.

  15. Adrian
    Member
    Posted 3 years ago #

    I think the gallery tab only appears after you have uploaded one or more pictures to a page/post. It's part of WordPress' in-built gallery system and is where you would (if you weren't using NextGen) embed a photo gallery to a page/post.

  16. asafche
    Member
    Posted 3 years ago #

    hm... my bad... checked it and found you're right.

    o.k. for those who will find this thread searching for how to remove the NextGen tab, based on this i think you can just add in your functions.php the "remove_filter", like this:
    remove_filter('media_upload_tabs', 'ngg_wp_upload_tabs');

    and for you, @Adrian -
    it has to be "gallery"... sorry.
    look at the media.php in automattic wordpress SVN.

    i can't find a proper solution for this misunderstanding.

    asafche.

Topic Closed

This topic has been closed to new replies.

About this Topic