WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Default to GD (2 posts)

  1. leemon
    Member
    Posted 1 year ago #

    Hi!

    Is there a way to make WordPress default to GD instead of Imagemagick when both are available?

    Thanks

  2. leemon
    Member
    Posted 1 year ago #

    Found the solution myself here:

    https://github.com/getsource/default-to-gd/blob/master/default-to-gd.php

    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' );

Topic Closed

This topic has been closed to new replies.

About this Topic