Adicione este código no functions.php:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
function image_editor_default_to_gd_fix( $editors ) { $gd_editor = 'WP_Image_Editor_GD'; $editors = array_diff( $editors, array( $gd_editor ) ); array_unshift( $editors, $gd_editor ); return $editors; } function fn_handle_upload($params){ error_log($params['type']); if($params['type'] == 'image/png'){ add_filter('wp_image_editors', 'image_editor_default_to_gd_fix'); } return $params; } function custom_image_resize_dimensions(){ add_filter('wp_image_editors', 'image_editor_default_to_gd_fix'); } add_filter('wp_handle_upload','fn_handle_upload'); add_filter('image_resize_dimensions','custom_image_resize_dimensions',0); /*específico para o plugin "Manual Image Crop"*/ add_filter('wp_ajax_mic_crop_image','custom_image_resize_dimensions',0); /*específico para o plugin "Regenerate Thumbnails"*/ add_filter('wp_ajax_regeneratethumbnail','custom_image_resize_dimensions',0); |