WP_Image_Editor_GD::test()public staticWP 3.5.0

Checks to see if current environment supports GD.

Метод класса: WP_Image_Editor_GD{}

Хуков нет.

Возвращает

true|false.

Использование

$result = WP_Image_Editor_GD::test( $args );
$args(массив)
-
По умолчанию: array()

Список изменений

С версии 3.5.0 Введена.

Код WP_Image_Editor_GD::test() WP 6.4.3

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;
}