| Server IP : 85.155.190.233 / Your IP : 216.73.216.103 Web Server : nginx/1.24.0 System : Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : wp-moonbloom ( 1001) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/moonbloom/wp-content/plugins/webp-converter-for-media/src/Action/ |
Upload File : |
<?php
namespace WebpConverter\Action;
use WebpConverter\HookableInterface;
/**
* Removes image from its output format when removing image from media library.
*/
class DeleteFileHandler implements HookableInterface {
/**
* {@inheritdoc}
*/
public function init_hooks(): void {
add_filter( 'wp_delete_file', [ $this, 'delete_attachment_file' ] );
}
/**
* Deletes output image based on server path of source image.
*
* @param string $path Server path of source image.
*
* @return string Server path of source image.
* @internal
*/
public function delete_attachment_file( string $path ): string {
do_action( 'webpc_delete_paths', [ $path ] );
return $path;
}
}