media_upload_tabs() is not deprecated. It is called only by
the_media_upload_tabs() (perfect naming, I know), which as well is only called once by
Edit - Just tested the filter with a plugin and while it's working and a
~/wp-includes/media-template.php. From a search through that, there's no filter to alter the output. Basically it's just one massive PHP function named
wp_print_media_templates() that wraps all the templates and that has some actions before and after different templates.
I just tried to
wp object and found
wp.media.view which seems to hold ... something.
wp.template that gets "underscore-
wp.media.template. Then I found the reference to
~/wp-includes/js/wp-util.js which then explains, that the argument for that JS function is an
#id that is prefixed by
Now that only is a wrapper for
_.memoize() which adds a custom callback "saves" computed results to "speed things up"... a bit. The contents are just a bunch of Regex-es that then get pushed to a function named
compiled(), which just is (again) a wrapper for
_.template( $( '#tmpl-' + id ).html(), null, options )
.. ok. There's as well stuff from
~/wp-includes/js/media-models.js involved and as I know close to nothing about Backbone anymore, I got no clue how to proceed from there. I'll leave my debugging plugin for this answer as well as the answer as starting point for others here.
defined( 'ABSPATH' ) or exit;
* Plugin Name: (#125669) Media Upload Tabs by role
* Description: Removes media upload tabs on a by-role base.
add_action( 'admin_footer', 'wpse125669MediaUploadTabsRemove', 0 );
if ( "edit.php" !== get_current_screen()->parent_file )
console.log( wp.media );