Ticket #7013: media.php.2.diff
| File media.php.2.diff, 1.4 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 if ( true == $autoclose ) 171 exit; 172 173 return; 171 174 } 172 175 173 176 /** … … 398 401 check_admin_referer('media-form'); 399 402 400 403 $errors = null; 404 $autoclose = true; 405 406 if ( empty( $_POST['autoclose'] ) ) 407 $autoclose = false; 401 408 402 409 if ( isset($_POST['send']) ) { 403 410 $keys = array_keys($_POST['send']); … … 468 475 } 469 476 470 477 $html = apply_filters('media_send_to_editor', $html, $send_id, $attachment); 471 return media_send_to_editor($html );478 return media_send_to_editor($html, $autoclose); 472 479 } 473 480 474 481 return $errors; … … 1516 1523 ?> 1517 1524 1518 1525 <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"> 1526 <div id="autoclose"><input type="checkbox" checked="checked" name="autoclose" /> Autoclose</div> 1519 1527 <input type="submit" class="hidden" name="save" value="" /> 1520 1528 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> 1521 1529 <?php wp_nonce_field('media-form'); ?>
