C:\xampp\htdocs\landing\wp-content\updraft\plugins-old\imagify\inc\common\attachments.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
defined
'ABSPATH' ) || die( 'Cheatin’ uh?' );

add_action'delete_attachment''imagify_trigger_delete_attachment_hook' );
/**
 * Trigger a common Imagify hook when an attachment is deleted.
 *
 * @since  1.9
 * @author Grégory Viguier
 *
 * @param int $post_id Attachment ID.
 */
function imagify_trigger_delete_attachment_hook$post_id ) {
    
$process imagify_get_optimization_process$post_id'wp' );

    if ( ! 
$process->is_valid() ) {
        return;
    }

    
imagify_trigger_delete_media_hook$process );
}

add_action'imagify_delete_media''imagify_cleanup_after_media_deletion' );
/**
 * Delete the backup file and the webp files when an attachement is deleted.
 *
 * @since  1.9
 * @author Grégory Viguier
 *
 * @param ProcessInterface $process An optimization process.
 */
function imagify_cleanup_after_media_deletion$process ) {
    if ( 
'wp' !== $process->get_media()->get_context() ) {
        return;
    }

    
/**
     * The optimization data will be automatically deleted by WP (post metas).
     * Delete the webp versions and the backup file.
     */
    
$process->delete_webp_files();
    
$process->delete_backup();
}

add_filter'ext2type''imagify_add_webp_type' );
/**
 * Add the webp extension to wp_get_ext_types().
 *
 * @since  1.9
 * @author Grégory Viguier
 *
 * @param  array $ext2type Multi-dimensional array with extensions for a default set of file types.
 * @return array
 */
function imagify_add_webp_type$ext2type ) {
    if ( ! 
in_array'webp'$ext2type['image'], true ) ) {
        
$ext2type['image'][] = 'webp';
    }
    return 
$ext2type;
}

/**
 * Set WP’s "big images threshold" to Imagify’s resizing value.
 *
 * @since  1.9.8
 * @since  WP 5.3
 * @author Grégory Viguier
 */
add_filter'big_image_size_threshold', [ imagify_get_context'wp' ), 'get_resizing_threshold' ], IMAGIFY_INT_MAX );
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586