Skip to content

Instantly share code, notes, and snippets.

@fearlex
Created October 10, 2016 20:00
Show Gist options
  • Save fearlex/e61ee26b6f9d6e951b3988d9a3a2c08e to your computer and use it in GitHub Desktop.
Save fearlex/e61ee26b6f9d6e951b3988d9a3a2c08e to your computer and use it in GitHub Desktop.
A Collection of Wordpress Snippets
// -- Changing Image Library Processor. Fix Http Error on Media Upload.
add_filter( 'wp_image_editors', 'prefix_image_editor_default_to_gd' );
/**
* Changing Image Library Processor.
*
* @param $editors
*
* @return array
*/
function prefix_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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment