WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP 3.5 and Hiding Media Tabs (6 posts)

  1. consumedesign
    Member
    Posted 1 year ago #

    I just upgraded a client to 3.5 and now they are doing the tabs differently... I used to hide the Insert from URL and Media Library using:

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

    But it no longer works in 3.5. Anyone know the new way to hide those? I tried to do a jquery remove() but it also no longer loads the js file on that as well, only when the page is entered. I wish they would have at least added an ID or something to the tabs so I can hide them using CSS.

  2. consumedesign
    Member
    Posted 1 year ago #

    Got the Insert from URL out using:

    function remove_media_tab($strings) {
    
    	unset($strings["insertFromUrlTitle"]);
    	return $strings;
    }
    add_filter('media_view_strings','remove_media_tab');

    Anyone know a good one for the media tab?

  3. consumedesign
    Member
    Posted 1 year ago #

    The new uploader kind stinks and don't have it resolved completely with the media tab since it does some odd things when I remove it. Oh well maybe it will be fixed in the next version.

  4. Joolee
    Member
    Posted 1 year ago #

    I like the new media manager but i dislike that it's not extendable :(

    I'd like to modify the options displayed when embedding media but it's all javascript now and I can't find a way to plug in to that.

    Previously, we could register a new "attachment_fields_to_edit" filter.

  5. OllieJones
    Member
    Posted 1 year ago #

    I'm with you, Joolee. The 'attachment_fields_to_edit' filter still gets called, but, umm, without any attachment fields.

    Dear WordPress.org people; can you suggest a way to work with the options displayed when adding media. I'd like users to be able to select an option to create a shortcode for certain media types.

  6. hiphopsmurf
    Member
    Posted 1 year ago #

    @consumedesign
    Adding $strings['createGalleryTitle'] to your function gets rid of the gallery tab.

    function remove_media_tab($strings) {
    
    	unset(
    		$strings["insertFromUrlTitle"],
    		$strings['createGalleryTitle']
    	);
    	return $strings;
    }
    add_filter('media_view_strings','remove_media_tab');

Topic Closed

This topic has been closed to new replies.

About this Topic