Ticket #7013: media.php.patch
| File media.php.patch, 3.3 KB (added by ocean90, 3 years ago) |
|---|
-
media.php
158 158 * 159 159 * @param unknown_type $html 160 160 */ 161 function media_send_to_editor($html ) {161 function media_send_to_editor($html, $autoclose) { 162 162 ?> 163 163 <script type="text/javascript"> 164 164 /* <![CDATA[ */ … … 167 167 /* ]]> */ 168 168 </script> 169 169 <?php 170 exit; 170 //var_dump($autoclose); 171 if ( $autoclose == true); 172 exit; 173 174 return; 171 175 } 172 176 173 177 /** … … 398 402 check_admin_referer('media-form'); 399 403 400 404 $errors = null; 401 405 $autoclose = true; 406 407 if ( isset($_POST['autoclose']) && empty( $_POST['autoclose']) ) 408 $autoclose = false; 409 //var_dump($autoclose); 410 402 411 if ( isset($_POST['send']) ) { 403 412 $keys = array_keys($_POST['send']); 404 413 $send_id = (int) array_shift($keys); 405 414 } 406 415 416 407 417 if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { 408 418 $post = $_post = get_post($attachment_id, ARRAY_A); 409 419 if ( isset($attachment['post_content']) ) … … 468 478 } 469 479 470 480 $html = apply_filters('media_send_to_editor', $html, $send_id, $attachment); 471 return media_send_to_editor($html );481 return media_send_to_editor($html, $autoclose); 472 482 } 473 483 474 484 return $errors; … … 485 495 $errors = array(); 486 496 $id = 0; 487 497 498 488 499 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 489 500 // Upload File button was clicked 490 501 $id = media_handle_upload('async-upload', $_REQUEST['post_id']); … … 510 521 $html = "<img src='" . esc_url($src) . "' alt='$alt'$class />"; 511 522 512 523 $html = apply_filters('image_send_to_editor_url', $html, esc_url_raw($src), $alt, $align); 513 return media_send_to_editor($html );524 return media_send_to_editor($html, $autoclose); 514 525 } 515 526 516 527 if ( !empty($_POST) ) { … … 1366 1377 <script type="text/javascript">post_id = <?php echo intval($_REQUEST['post_id']); ?>;</script> 1367 1378 <div id="media-upload-header"> 1368 1379 <?php the_media_upload_tabs(); ?> 1380 1369 1381 </div> 1370 1382 <?php 1371 1383 } … … 1426 1438 SWFUpload.onload = function() { 1427 1439 var settings = { 1428 1440 button_text: '<span class="button"><?php _e('Select Files'); ?></span>', 1429 button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; }',1430 button_height: "2 4",1441 button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; font-size: 11px; text-shadow: 0 1px 0 #FFFFFF; color:#464646; }', 1442 button_height: "23", 1431 1443 button_width: "132", 1432 button_text_top_padding: 2,1444 button_text_top_padding: 3, 1433 1445 button_image_url: '<?php echo includes_url('images/upload.png'); ?>', 1434 1446 button_placeholder_id: "flash-browse-button", 1435 1447 upload_url : "<?php echo esc_attr( $flash_action_url ); ?>", … … 1516 1528 ?> 1517 1529 1518 1530 <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form"> 1531 <div id="autoclose"><input type="checkbox" checked="checked" name="autoclose" /> Autoclose</div> 1519 1532 <input type="submit" class="hidden" name="save" value="" /> 1520 1533 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> 1521 1534 <?php wp_nonce_field('media-form'); ?>