Last active
January 8, 2019 07:27
-
-
Save sdhundhalva/69fd117c2b0ab5a948d5b5ccb2d6558e to your computer and use it in GitHub Desktop.
Fixed WordPress WP-Media uploading error. Put this code in functions.php file.
This file contains hidden or 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 | |
/* | |
* Resolve HTTP Error. | |
*/ | |
function ms_image_editor_default_to_gd($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', 'ms_image_editor_default_to_gd'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment