Skip to content

Instantly share code, notes, and snippets.

@vietrick
Created June 25, 2022 07:42
Show Gist options
  • Save vietrick/80c47b38d22735b05de249e078546ff9 to your computer and use it in GitHub Desktop.
Save vietrick/80c47b38d22735b05de249e078546ff9 to your computer and use it in GitHub Desktop.
Switch to WP_Image_Editor_GD
/**
@@ Sửa lỗi Post-Processing of Image Failed WordPress
@@ Sử dụng module GD Library để xử lý hình ảnh Wordpress
**/
function wpb_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', 'wpb_image_editor_default_to_gd' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment