Closed andreiglingeanu closed 7 years ago
The code is robust enough to be merged and does not introduce any possible complications. Feel free to raise any issues or questions with it and please do it :)
can turn it on in some useful scenarios.
like?
@danyj Like launching that particular task as part of another task collection :) In order to manually regenerate thumbnails in background (without everything else that comes with applying a demo content), without any plugins or third-party dependencies.
This pull request introduces an option to delete remove the old attachment sizes, which are no longer used. Highly inspired by
--skip-delete
cli flag forwp media regenerate
command. This option is disabled by default and can be enabled ONLY after rigorous testing!That is achieved by removing all the existing attachment sizes right before starting the regeneration phase of the task.
How to test this feature:
framework/extensions/backups/includes/module/tasks/type/class-fw-ext-backups-task-type-image-sizes-restore.php
array('remove_old_files' => false)
to be like that:array('remove_old_files' => true)
By default this does nothing and we can turn it on in some useful scenarios. The implementation is inspired from https://github.com/wp-cli/wp-cli.
cc. @ViorelEremia @danyj