Exclude image thumbnails in backups created in UpdraftPlus

Exclude image thumbnails in backups created in UpdraftPlus on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'updraftplus_exclude_file', 'de_updraftplus_exclude_file', 10, 2 );

function de_updraftplus_exclude_file( $filter, $file ) {
    return preg_match( "/-\d+x\d+\.(?:png|jpe?g|bmp|tiff|gif|webp|avif)$/", $file ) ? true : $filter;
}