Remove the Resize files checkbox for now (revisit in 3.4), fixes #19174
git-svn-id: http://svn.automattic.com/wordpress/trunk@19223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b297f9061c
commit
623220187a
|
@ -329,20 +329,6 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
|
|||
if ( false === @ move_uploaded_file( $file['tmp_name'], $tmp_file ) )
|
||||
return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
|
||||
|
||||
// If a resize was requested, perform the resize.
|
||||
$image_resize = isset( $_POST['image_resize'] ) && 'true' == $_POST['image_resize'];
|
||||
$do_resize = apply_filters( 'wp_upload_resize', $image_resize );
|
||||
$size = @getimagesize( $tmp_file );
|
||||
if ( $do_resize && $size ) {
|
||||
$old_temp = $tmp_file;
|
||||
$tmp_file = image_resize( $tmp_file, (int) get_option('large_size_w'), (int) get_option('large_size_h'), 0, 'resized');
|
||||
if ( ! is_wp_error($tmp_file) ) {
|
||||
unlink($old_temp);
|
||||
} else {
|
||||
$tmp_file = $old_temp;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy the temporary file into its destination
|
||||
$new_file = $uploads['path'] . "/$filename";
|
||||
copy( $tmp_file, $new_file );
|
||||
|
|
|
@ -1984,32 +1984,6 @@ function _insert_into_post_button($type) {
|
|||
';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
function media_upload_max_image_resize() {
|
||||
$checked = get_user_setting('upload_resize') ? ' checked="true"' : '';
|
||||
$a = $end = '';
|
||||
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
$a = '<a href="' . esc_url( admin_url( 'options-media.php' ) ) . '" target="_blank">';
|
||||
$end = '</a>';
|
||||
}
|
||||
?>
|
||||
<p class="hide-if-no-js"><label>
|
||||
<input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> />
|
||||
<?php
|
||||
/* translators: %1$s is link start tag, %2$s is link end tag, %3$d is width, %4$d is height*/
|
||||
printf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d × %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) );
|
||||
?>
|
||||
</label></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action( 'post-upload-ui', 'media_upload_max_image_resize' );
|
||||
|
||||
add_filter( 'async_upload_image', 'get_media_item', 10, 2 );
|
||||
add_filter( 'async_upload_audio', 'get_media_item', 10, 2 );
|
||||
add_filter( 'async_upload_video', 'get_media_item', 10, 2 );
|
||||
|
|
|
@ -78,18 +78,6 @@ function uploadSuccess(fileObj, serverData) {
|
|||
jQuery('#attachments-count').text(1 * jQuery('#attachments-count').text() + 1);
|
||||
}
|
||||
|
||||
function setResize(arg) {
|
||||
if ( arg ) {
|
||||
if ( uploader.features.jpgresize )
|
||||
uploader.settings['resize'] = { width: resize_width, height: resize_height, quality: 100 };
|
||||
else
|
||||
uploader.settings.multipart_params.image_resize = true;
|
||||
} else {
|
||||
delete(uploader.settings.resize);
|
||||
delete(uploader.settings.multipart_params.image_resize);
|
||||
}
|
||||
}
|
||||
|
||||
function prepareMediaItem(fileObj, serverData) {
|
||||
var f = ( typeof shortform == 'undefined' ) ? 1 : 2, item = jQuery('#media-item-' + fileObj.id);
|
||||
// Move the progress bar to 100%
|
||||
|
@ -352,20 +340,7 @@ jQuery(document).ready(function($){
|
|||
uploader_init = function() {
|
||||
uploader = new plupload.Uploader(wpUploaderInit);
|
||||
|
||||
$('#image_resize').bind('change', function() {
|
||||
var arg = $(this).prop('checked');
|
||||
|
||||
setResize( arg );
|
||||
|
||||
if ( arg )
|
||||
setUserSetting('upload_resize', '1');
|
||||
else
|
||||
deleteUserSetting('upload_resize');
|
||||
});
|
||||
|
||||
uploader.bind('Init', function(up) {
|
||||
setResize( getUserSetting('upload_resize', false) );
|
||||
|
||||
if ( up.features.dragdrop ) {
|
||||
$('#plupload-upload-ui').addClass('drag-drop');
|
||||
$('#drag-drop-area').bind('dragover.wp-uploader', function(){ // dragenter doesn't fire right :(
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -220,7 +220,7 @@ function wp_default_scripts( &$scripts ) {
|
|||
// cannot use the plupload.full.js, as it loads browserplus init JS from Yahoo
|
||||
$scripts->add( 'plupload-all', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1511');
|
||||
|
||||
$scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery'), '20111102');
|
||||
$scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery'), '20111108');
|
||||
$scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
|
||||
|
||||
// keep 'swfupload' for back-compat.
|
||||
|
|
Loading…
Reference in New Issue