Ticket #13817: media.php.diff
File media.php.diff, 2.4 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/media.php
1122 1122 1123 1123 $default_args = array( 'errors' => null, 'send' => $post->post_parent ? post_type_supports( get_post_type( $post->post_parent ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true ); 1124 1124 $args = wp_parse_args( $args, $default_args ); 1125 $args = apply_filters( 'get_media_item_args', $args ); 1125 1126 extract( $args, EXTR_SKIP ); 1126 1127 1127 1128 $toggle_on = __( 'Show' ); … … 1397 1398 1398 1399 do_action('pre-upload-ui'); 1399 1400 1400 if ( $flash ) : ?> 1401 if ( $flash ) : 1402 1403 // Set the post params, which SWFUpload will post back with the file, and pass 1404 // them through a filter. 1405 $post_params = array( 1406 "post_id" => $post_id, 1407 "auth_cookie" => (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]), 1408 "logged_in_cookie" => $_COOKIE[LOGGED_IN_COOKIE], 1409 "_wpnonce" => wp_create_nonce('media-form'), 1410 "type" => $type, 1411 "tab" => $tab, 1412 "short" => "1", 1413 ); 1414 $post_params = apply_filters( 'swfupload_post_params', $post_params ); 1415 $p = array(); 1416 foreach ( $post_params as $param => & $val ) 1417 $p[] = "\t\t'$param' : '$val'"; 1418 $post_params_str = implode( ", \n", $p ); 1419 1420 ?> 1401 1421 <script type="text/javascript"> 1402 1422 //<![CDATA[ 1403 1423 var swfu; … … 1415 1435 file_post_name: "async-upload", 1416 1436 file_types: "<?php echo apply_filters('upload_file_glob', '*.*'); ?>", 1417 1437 post_params : { 1418 "post_id" : "<?php echo $post_id; ?>", 1419 "auth_cookie" : "<?php echo (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]); ?>", 1420 "logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>", 1421 "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>", 1422 "type" : "<?php echo $type; ?>", 1423 "tab" : "<?php echo $tab; ?>", 1424 "short" : "1" 1438 <?php echo $post_params_str; ?> 1425 1439 }, 1426 1440 file_size_limit : "<?php echo $max_upload_size; ?>b", 1427 1441 file_dialog_start_handler : fileDialogStart, … … 1429 1443 upload_start_handler : uploadStart, 1430 1444 upload_progress_handler : uploadProgress, 1431 1445 upload_error_handler : uploadError, 1432 upload_success_handler : uploadSuccess,1446 upload_success_handler : <?php echo apply_filters( 'swfupload_success_handler', 'uploadSuccess' ); ?>, 1433 1447 upload_complete_handler : uploadComplete, 1434 1448 file_queue_error_handler : fileQueueError, 1435 1449 file_dialog_complete_handler : fileDialogComplete,