Hello @toologic,
Thanks for your message.
See the plugin FAQ for information on how to do this. Let me tell you that you should use the webpc_attachment_paths
filter.
Best,
Mateusz
@mateuszgbiorczyk Thanks for the quick response.
But that’s not really what I’m trying to do.
I tested the ‘webpc_files_paths’ filter, but it is used in post-processing the list of files. It is used, when the list of files has already been formed.
I want to exclude a directory from scanning. For example, so that files in the /wp-content/uploads/images/plans/ directory are not scanned to check for the presence of graphic files and are not processed (not converted)
This is important because my directory contains thousands of files over several years, they are not used on the front-end of the site.
@toologic Yes, that’s right. But if you delete from this list those files you do not want to use this will not be converted.
Mateusz,
Let’s calculate the resource costs. We need to create an array and fill it with strings with file names. For example 12,000 pieces. Then, in a loop, go through this array and check for the entry of the directory mask in the full file name. If there is a match, clear the array element. (this is what the webpc_files_paths
filter is doing now)
It is clear that this is a one-time task – to convert all files in the /uploads catalog, but the resources are also not endless.
Therefore, I suggest you, in the development of your wonderful plugin, provide a mechanism for excluding a directory (list of directories) from scanning and converting at the plugin configuration stage.
Thanks.
@toologic I have just released update 3.2.0. Among other things, I added filters that will allow you to better exclude directories and files from converting.
In the plugin FAQ, I added a question that explains how to use such filters.
Please let me know if this solution is useful for you.