Always send nocache_headers() for admin-ajax.php. This prevents iOS from caching ajax calls. http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results
Turn off multi selection uploads for mobile devices. Currently Plupload cannot upload multiple files in iOS Safari. Only the first file makes it to the queue. Empty wp on unload to work around caching in iOS Safari. Props azaozz, miqrogroove, nacin fixes #22552 git-svn-id: http://core.svn.wordpress.org/trunk@22872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c1bd9e3795
commit
cc9b248937
|
@ -36,6 +36,7 @@ require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
|||
@header( 'X-Robots-Tag: noindex' );
|
||||
|
||||
send_nosniff_header();
|
||||
nocache_headers();
|
||||
|
||||
do_action( 'admin_init' );
|
||||
|
||||
|
|
|
@ -1508,6 +1508,11 @@ $plupload_init = array(
|
|||
'multipart_params' => $post_params
|
||||
);
|
||||
|
||||
// Multi-file uploading doesn't currently work in iOS Safari,
|
||||
// single-file allows the built-in camera to be used as source for images
|
||||
if ( wp_is_mobile() )
|
||||
$plupload_init['multi_selection'] = false;
|
||||
|
||||
$plupload_init = apply_filters( 'plupload_init', $plupload_init );
|
||||
|
||||
?>
|
||||
|
|
|
@ -809,4 +809,9 @@ window.wp = window.wp || {};
|
|||
}
|
||||
});
|
||||
|
||||
// Clean up. Prevents mobile browsers caching
|
||||
$(window).on('unload', function(){
|
||||
window.wp = null;
|
||||
});
|
||||
|
||||
}(jQuery));
|
|
@ -1254,6 +1254,11 @@ function wp_plupload_default_settings() {
|
|||
'multipart' => true,
|
||||
'urlstream_upload' => true,
|
||||
);
|
||||
|
||||
// Multi-file uploading doesn't currently work in iOS Safari,
|
||||
// single-file allows the built-in camera to be used as source for images
|
||||
if ( wp_is_mobile() )
|
||||
$defaults['multi_selection'] = false;
|
||||
|
||||
$defaults = apply_filters( 'plupload_default_settings', $defaults );
|
||||
|
||||
|
|
Loading…
Reference in New Issue