Skip to content

Instantly share code, notes, and snippets.

@gizalink
Created October 7, 2015 03:41
Show Gist options
  • Save gizalink/b3fa5f04a07625cef1d1 to your computer and use it in GitHub Desktop.
Save gizalink/b3fa5f04a07625cef1d1 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Default to GD
Plugin URI: http://wordpress.org/extend/plugins/default-to-gd
Description: Sets GD as default WP_Image_Editor class.
Author: Mike Schroder
Version: 1.0
Author URI: http://www.getsource.net/
*/
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