Last active
September 10, 2024 04:20
-
-
Save khoipro/ec1a349240d09349c76965bedccf551c to your computer and use it in GitHub Desktop.
Fix image not upload in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Error while uploading image: The server cannot process the image. This can happen if the server is busy or does not have enough resouces to complete the task. | |
// Error (Vietnamese): Máy chủ không thể xử lý hình ảnh. | |
function codetot_image_editor_default_to_gd_library( $editors ) { | |
$gd_editor = 'WP_Image_Editor_GD'; | |
$editors = array_diff( $editors, array( $gd_editor ) ); | |
array_unshift( $editors, $gd_editor ); | |
return $editors; | |
} | |
add_filter( 'wp_image_editors', 'codetot_image_editor_default_to_gd_library' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment