Un motore di ricerca WordPress per sviluppatori e autori di temi



_rotate_image_resource ›

Da2.9.0
Deprecato3.5.0
_rotate_image_resource ( $img, $angle )
Parametri: (2)
  • (resource) $img Image resource.
    Richiesto:
  • (float|int) $angle Image rotation angle, in degrees.
    Richiesto:
Vedi:
  • WP_Image_Editor::rotate()
Ritorna:
  • (resource|false) GD image resource, false otherwise.
Definito a:
Codex:

Returns an image resource. Internal use only.



Sorgenti

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