Attachment_Hooks
Keeps the sidecars in step with the attachments they belong to.
Namespace: WebberZone\Image_Optimizer
Since: 1.0.0
Source: includes/class-attachment-hooks.php line 21
Methods
__construct()
Constructor.
Since: 1.0.0
Line: 28
public function __construct( );
on_metadata_updated()
Convert or queue changed files without modifying attachment metadata.
Since: 1.0.0
Line: 44
public function on_metadata_updated( $data, $attachment_id ): array<string,;
| Type | Name | Description |
|---|---|---|
mixed |
$data |
Attachment metadata about to be stored. |
int |
$attachment_id |
Attachment ID. |
Returns: array<string, — mixed> Unmodified metadata.
on_delete_attachment()
Remove sidecars and the queue row before attachment files disappear.
Since: 1.0.0
Line: 71
public function on_delete_attachment( $attachment_id ): void;
| Type | Name | Description |
|---|---|---|
int |
$attachment_id |
Attachment ID. |
Returns: void