Does WordPress support Plupload chunking when uploading asynchronously?

To the best of my knowledge, no, the async-upload process on the WordPress side does not support chunking from plupload. You can find this code in /wp-admin/async-upload.php. To handle the uploaded file, it calls the wp_ajax_upload_attachment() function, in the ajax-actions.php file. This function refers directly to the PHP $_FILES array, meaning that the file would … Read more

How do I increase the upload size only when editing special pages?

I think you are on the right track with your idea of checking if the right page is being viewed within the callback attached to the upload_size_limit hook. This code demonstrates changing the upload size if one of the special pages is being viewed, and returning the standard max upload size otherwise: function wpse239631_change_upload_size( $u_bytes, … Read more

Get File Object from wp.Uploader

You can’t hook it directly as wp.Uploader doesn’t expose it but you can use its init() to hook its internal pluploader instance: add_action( ‘admin_print_footer_scripts’, function () { ?> <script type=”text/javascript”> (function ($) { if (typeof wp.Uploader === ‘function’) { $.extend( wp.Uploader.prototype, { init : function() { // plupload ‘PostInit’ this.uploader.bind(‘BeforeUpload’, function(file) { console.log(‘BeforeUpload file=%o’, file); … Read more

How to disable plupload completely from latest wordpress 3.6 and make browser upload default

This is how the plupload upoader is loaded on Media > Add New do_action( ‘pre-plupload-upload-ui’ ); // all the html output for plupload’s use do_action( ‘post-plupload-upload-ui’ ); If it was this instead: ob_start(); // all the html output for plupload’s use ob_end_clean(); Then no UI, no plupload: add_action( ‘pre-plupload-upload-ui’, ‘ob_start’ ); add_action( ‘post-plupload-upload-ui’, ‘ob_end_clean’ ); … Read more

How to set post_id to 0 when you upload image via Add media button. (async-upload.php)

Finally found an answer for this and checked it worked on my situation. How to upload image without post ID using the new media uploader? // Set post_id to 0 when Add Media button clicked jQuery(‘#insert-media-button’).on(‘click’, function( event ){ event.preventDefault(); wp.media.model.settings.post.id = 0; }); This will set all the images uploaded via Add media button … Read more

Plupload resize for worpdress

I’ve done a Plupload using the Front End. The WordPress Plupload is very customised, so I’ve implemented from the scratch as a Plugin. I’ll show an example using functions.php Download the Plupload from http://www.plupload.com/download/ and put in your theme inside a js/thirdparty/plupload/{all_files} Code to use on functions.php //Plupload File wp_enqueue_script( ‘plupload’, get_template_directory_uri() . ‘/js/thirdparty/plupload/js/plupload.full.min.js’, array( … Read more