• 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 ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter justbishop

    (@justbishop)

    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.

    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', ("https://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!

    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?

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

    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
    https://blog.mondayinthesun.com.au/2010/09/wp-hide-photos-uploaded-by-other-in.html

    Hope this help.

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

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

    @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);

    @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).

    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’);

    @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!!!

    asafche

    (@asafche)

    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?

    Adrian

    (@adrianburns)

    @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!

    asafche

    (@asafche)

    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.

    Adrian

    (@adrianburns)

    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.

    asafche

    (@asafche)

    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.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Hide Some Media Upload Buttons/Functions’ is closed to new replies.