#22925 closed defect (bug) (invalid)
media_upload_tabs filter not functioning
Reported by: | kegster | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
When using the media_upload_tabs filter, the array passed through contains a 'library' item that usually can be unset, therefore removing the Media Library tab from the front-end uploader. This no longer works. I cannot even rename the labels using this method, however the array of tabs is still coming through, and modifying it does nothing. The filter is still active, but appears to do nothing.
Change History (5)
#3
@
11 years ago
- Keywords reporter-feedback added
Hi kegster!
Apologies that it took so long for a reply.
This filter is effectively deprecated, along with the old-style media uploader, as it only applies to the previous media upload modal, and not the new one.
Is the filter not working for you when you're using it to modify the old-style modal, or is the issue that you can't modify the tabs of the new media modal with this filter?
#4
@
11 years ago
- Keywords reporter-feedback removed
- Resolution set to invalid
- Status changed from new to closed
I can confirm media_upload_tabs still works for the old media modal.
Boilerplate:
<?php // Remove the URL tab add_filter( 'media_upload_tabs', function($tabs ) { unset( $tabs['type_url'] ); return $tabs; } ); /** * I WANT THE OLD UPLOADER BACK * All code by: A.Morita * URL: http://wordpress.org/support/topic/is-there-a-way-to-disable-the-new-media-manager/ */ /** * Old upload Thickbox */ add_action( 'admin_head', 'remove_media_buttons' ); function remove_media_buttons() { remove_action( 'media_buttons', 'media_buttons' ); add_action( 'media_buttons', 'old_media_buttons' ); } function old_media_buttons( $editor_id = 'content' ) { $context = apply_filters( 'media_buttons_context', __('Upload/Insert %s') ); $img = '<img src="' . esc_url( admin_url( 'images/media-button.png?ver=20111005' ) ) . '" width="15" height="15" />'; echo '<a href="' . esc_url( get_upload_iframe_src() ) . '" class="thickbox add_media" id="' . esc_attr( $editor_id ) . '-add_media" title="' . esc_attr__( 'Add Media' ) . '" onclick="return false;">' . sprintf( $context, $img ) . '</a>'; } /** * Featured image */ add_action( 'wp_default_scripts', 'unset_media_views', 999, 1 ); add_action( 'admin_head', 'remove_wp_print_media_templates' ); function unset_media_views($scripts) { unset( $scripts->registered['media-views'] ); } function remove_wp_print_media_templates() { remove_action( 'admin_footer', 'wp_print_media_templates' ); remove_action( 'wp_footer', 'wp_print_media_templates' ); } /** * Adjust Full Screen behavior */ add_action( 'after_wp_tiny_mce', 'fullscreen_media_button' ); function fullscreen_media_button() { ?> <script type="text/javascript"> fullscreen.medialib = function() { var href = jQuery('div#wp-content-media-buttons a.thickbox').attr('href') || ''; tb_show('', href); } </script> <?php }
Modifying the new tabs is a bit more tricky, keep an eye on my Backbone media documentation plugin for an example of that sometime soon.
Closing out, feel free to reopen if there's more to it.
This happened as of the 3.5 upgrade, of course.