0)
$slimit = wp_convert_hr_to_bytes($slimit.'M');
else
$slimit = wp_max_upload_size();
$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' => (current_user_can('manage_options')?'package_file':'attach_file'),
'multiple_queues' => true,
'max_file_size' => $slimit.'b',
'url' => admin_url('admin-ajax.php'),
'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'), 'extensions' => get_option('__wpdm_allowed_file_types','*'))),
'multipart' => true,
'urlstream_upload' => true,
// additional post data to send to our ajax hook
'multipart_params' => array(
'_ajax_nonce' => wp_create_nonce(NONCE_KEY),
'__noconflict' => 1,
'__wpdmfm_upload' => wp_create_nonce(NONCE_KEY),
'action' => (current_user_can('manage_options')?'wpdm_admin_upload_file':'wpdm_frontend_file_upload'), // the ajax action name
),
);
if(get_option('__wpdm_chunk_upload',0) == 1){
$plupload_init['chunk_size'] = get_option('__wpdm_chunk_size', 1024).'kb';
$plupload_init['max_retries'] = 3;
} else
$plupload_init['max_file_size'] = wp_max_upload_size().'b';
// we should probably not apply this filter, plugins may expect wp's media uploader...
$plupload_init = apply_filters('plupload_init', $plupload_init); ?>