Uma área de pesquisa sobre o WordPress para devs e autores do tema



_rotate_image_resource ›

Desde2.9.0
Obsoleto3.5.0
_rotate_image_resource ( $img, $angle )
Parâmetros: (2)
  • (resource) $img Image resource.
    Required: Yes
  • (float|int) $angle Image rotation angle, in degrees.
    Required: Yes
Ver:
  • WP_Image_Editor::rotate()
Retorna:
  • (resource|false) GD image resource, false otherwise.
Definido em:
Codex:

Returns an image resource. Internal use only.



Fonte

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 ) ) {
			imagedestroy( $img );
			$img = $rotated;
		}
	}
	return $img;
}