Force WordPress 3.3 to use Flash uploader

Context Searching for .swf in the Core, found this in /wp-admin/includes/media.php: $plupload_init = array( ‘runtimes’ => ‘html5,silverlight,flash,html4’, ‘browse_button’ => ‘plupload-browse-button’, ‘container’ => ‘plupload-upload-ui’, ‘drop_element’ => ‘drag-drop-area’, ‘file_data_name’ => ‘async-upload’, ‘multiple_queues’ => true, ‘max_file_size’ => $max_upload_size . ‘b’, ‘url’ => $upload_action_url, ‘flash_swf_url’ => includes_url(‘js/plupload/plupload.flash.swf’), ‘silverlight_xap_url’ => includes_url(‘js/plupload/plupload.silverlight.xap’), ‘filters’ => array( array(‘title’ => __( ‘Allowed Files’ ), … Read more

Display attachments by ID in a wp.media frame

You can always filter on the client side: var query = wp.media.query(); query.filterWithIds = function(ids) { return _(this.models.filter(function(c) { return _.contains(ids, c.id); })); }; var res = query.filterWithIds([6,87]); // change these to your IDs res.each(function(v){ console.log( v.toJSON() ); }); Disclaimer: found the beautiful filterWithIds function in this SO question.

Remote upload file to server B

Try adding die(‘message’); and use that to debug where it fails. Also try and use ftp://external-server.com as opposed to just external-server.com. Also make sure you use your FTP password. And try it on active mode as opposed to passive mode. When I was trying to upload by FTP that’s what I had to do. Also … Read more

Decrease file size upload in Media

That number is taken from wp_max_upload_size(), and there is a filter: ‘upload_size_limit’. See wp-admin/includes/template.php. So this should work (not tested): add_filter( ‘upload_size_limit’, ‘wpse_70754_change_upload_size’ ); function wpse_70754_change_upload_size() { return 1000 * 1024; }

Organize uploads by year, month and day

Code based in other Answer of mine and this SO Answer. It uses the post/page/cpt publish date to build the paths. Note that $the_post->post_date_gmt is also available. add_filter(‘wp_handle_upload_prefilter’, ‘wpse_70946_handle_upload_prefilter’); add_filter(‘wp_handle_upload’, ‘wpse_70946_handle_upload’); function wpse_70946_handle_upload_prefilter( $file ) { add_filter(‘upload_dir’, ‘wpse_70946_custom_upload_dir’); return $file; } function wpse_70946_handle_upload( $fileinfo ) { remove_filter(‘upload_dir’, ‘wpse_70946_custom_upload_dir’); return $fileinfo; } function wpse_70946_custom_upload_dir($path) { /* … Read more