This is an old thread but for me still as still as relevant. I have been fiddling and has come up with this code for adding a media tab here, maybe someone want to continue for how the handle content for the tab.
1 2 3 | add_action('admin_enqueue_scripts', function(){ wp_enqueue_script( 'my-media-tab', plugin_dir_url( __FILE__ ) . '/js/mytab.js', array( 'jquery' ), '', true ); }); |
And then the js file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | var l10n = wp.media.view.l10n; wp.media.view.MediaFrame.Select.prototype.browseRouter = function( routerView ) { routerView.set({ upload: { text: l10n.uploadFilesTitle, priority: 20 }, browse: { text: l10n.mediaLibraryTitle, priority: 40 }, my_tab: { text: "My tab", priority: 60 } }); }; |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.