wp-includes/class-wp-image-editor-gd.php:416Rotates current image counter-clockwise by $angle.
$anglefloattrue|WP_Error public function rotate( $angle ) { if ( function_exists( 'imagerotate' ) ) { $transparency = imagecolorallocatealpha( $this->image, 255, 255, 255, 127 ); $rotated = imagerotate( $this->image, $angle, $transparency ); if ( is_gd_image( $rotated ) ) { imagealphablending( $rotated, true ); imagesavealpha( $rotated, true ); if ( PHP_VERSION_ID < 80000 ) { // imagedestroy() has no effect as of PHP 8.0. imagedestroy( $this->image ); } $this->image = $rotated; $this->update_size(); return true; } } return new WP_Error( 'image_rotate_error', __( 'Image rotate failed.' ), $this->file ); }Introduced in 3.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-image-editor-gd.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.