WordPress.org

Ready to get started?Download WordPress

Forums

Stop Authors from uploading to the media library (4 posts)

  1. HorrorUK
    Member
    Posted 1 year ago #

    I've been asked by somebody if it is possible to remove the option for those who are 'Authors' to upload to the media library.

    The idea is that there will be images that they can choose from, and these are the only ones they can use, so they don't want the option to be there to upload their own images.

    If this could be done in Multisite, that would be even better, with the user having access to the main gallery, that way the images won't have to be uploaded each time.

    Thanks.

  2. You can add a filter to remove the "from computer" tab. You will also need to filter the default tab.

    add_filter( 'media_upload_tabs', 'huk_remove_upload_tab', 10, 1 );
    	function huk_remove_upload_tab( $_default_tabs ) {
    		unset( $_default_tabs['type'] ); //This is the from computer upload tab
    
    		return ( $_default_tabs );
    	}
    
    	add_filter( 'media_upload_default_tab', 'huk_set_default_tab' );
    	function huk_set_default_tab( $tab ) {
    		return 'library';
    	}
  3. HorrorUK
    Member
    Posted 1 year ago #

    Thank you Chris.

    Where should I add this filter?

  4. MrDamasajaga
    Member
    Posted 1 year ago #

    This doesn't seem to work in WordPress 3.5.

    The default tab filter works in a front end plugin of mine, but in the back end it's no use.

    Unsetting tabs also doesn't work anymore ... New ideas anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.