With WordPress 3.5, the complete media manager is revamped. This is the biggest change that has come to this new version of WordPress, and it can be instantly noticed after updating. When we click on the “Insert Media” button from the post editor, we can see a new popup window with “Media Library” tab selected by default. But many users might want to open the “Upload Files” tab, instead. In this quick tip, you’ll learn how to open Upload Files by default, instead of the Media Library.

insert-media-wp

Before proceeding forward, note that you can still upload media (images, video, PDFs, etc) from the media library too, by just dragging and dropping the media. There’s no need to click on the Upload Files link for that. But some of you may not prefer uploading files to WordPress by drag and drop, and instead, want to select files manually through the “Browse” window. This is something that can be done only through the Upload Files tab.

To open Upload Files by default, as the first option, simply copy and paste the below code to the functions.php file.

<?php } ?>
add_action( 'admin_footer-post-new.php', 'media_manager_default' );
add_action( 'admin_footer-post.php', 'media_manager_default' );

function media_manager_default() {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
wp.media.controller.Library.prototype.defaults.contentUserSetting=false;
});
</script>
<?php } ?>

That’s all you need to do. Now you can open your media manager and you’ll be directly able to click on “Select Files” button, instead of first clicking on Upload Files and then on Select Files. Of course, you can also drag and drop files in this window. You can use any method to upload a media file.

(Code via: WP Forums)

2 thoughts on “How to Make “Upload Files” Selected by Default When Inserting Media”
  1. Now this little pearl has saved me making those extra clicks, time is money as they say. I never got the ordering, I only ever use the ‘upload files’ tab anyway, much appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *