Remove/reorder tabs from Insert media?

Question

I am trying to hide two tabs from the Insert media window that is shown in posts.
I managed to hide Media Library and Upload files from the top tab, but I am still presented the Upload files tab when I open Insert media. But as you can see the tab title is gone.
How do I manage to hide these tabs completely from being accessed?
And how do I reorder the tabs so that my custom tab Sample Media is the first one?

enter image description here

This is the code I have used to hide Upload files and Media Library:

function remove_medialibrary_tab($strings) {
            unset($strings["uploadFilesTitle"]);
            unset($strings["mediaLibraryTitle"]);
         return $strings;
 }
 add_filter('media_view_strings','remove_medialibrary_tab');
0
jockebq 3 months 0 Answers 16 views 0

Leave an answer