WordPress at a glance
function is not described

_rotate_image_resource() WP 2.9.0

Deprecated in 3.5.0. It is no longer supported and can be removed in future releases. Use WP_Image_Editor::rotate() instead.

Returns an image resource. Internal use only.

  • See: WP_Image_Editor::rotate()

No Hooks.


resource/false. GD image resource, false otherwise.


_rotate_image_resource( $img, $angle );
$img(resource) (required)
Image resource.
$angle(float/int) (required)
Image rotation angle, in degrees.

Code of rotate image resource: wp-admin/includes/image-edit.php VER 5.0.3

function _rotate_image_resource($img, $angle) {
	_deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::rotate()' );
	if ( function_exists('imagerotate') ) {
		$rotated = imagerotate($img, $angle, 0);
		if ( is_resource($rotated) ) {
			$img = $rotated;
	return $img;