Clanbite Since 1.6.3

bake_avatar( int $user_id, int $source_id, float $x, float $y, float $zoom ): int|\WP_Error

Cut the chosen square out of the original avatar and make it the avatar.

public static

Class: Kernowdev\Clanbite\Extensions\Players\Player_Media

Parameters

$user_id (int) Required

Player.

$source_id (int) Required

Attachment ID of the original image.

$x (float) Required

Focal point, 0 to 1.

$y (float) Required

Focal point, 0 to 1.

$zoom (float) Required

Zoom, 1 to MAX_ZOOM.

Returns

int|\WP_Error Attachment ID of the new avatar.

Defined in inc/extensions/players/class-player-media.php

Changelog

VersionDescription
1.6.3Introduced.