WP_Image_Editor_GD::test( array $args = array() ): bool

In this article

Checks to see if current environment supports GD.

Parameters

$argsarrayoptional

Default:array()

Return

bool

Source

public static function test( $args = array() ) {
	if ( ! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) {
		return false;
	}

	// On some setups GD library does not provide imagerotate() - Ticket #11536.
	if ( isset( $args['methods'] ) &&
		in_array( 'rotate', $args['methods'], true ) &&
		! function_exists( 'imagerotate' ) ) {

			return false;
	}

	return true;
}

Changelog

VersionDescription
3.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.