Skip to content

Instantly share code, notes, and snippets.

@landbryo
Last active May 24, 2018 19:20
Show Gist options
  • Save landbryo/b434812dbcb2e539699c5bfd3aa148fa to your computer and use it in GitHub Desktop.
Save landbryo/b434812dbcb2e539699c5bfd3aa148fa to your computer and use it in GitHub Desktop.
Use this function or something similar to change the image editor it is using. This will often fix media library image upload problems. Helpful resources: https://developer.wordpress.org/reference/hooks/wp_image_editors/ https://developer.wordpress.
///////////////////////
// CHANGE IMG EDITOR //
///////////////////////
function landbryo_img_edit($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}
add_filter( 'wp_image_editors', 'landbryo_img_edit' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment