Closed rosell-dk closed 3 years ago
Adding annotations... https://make.wordpress.org/cli/handbook/references/documentation-standards/ https://firxworx.com/blog/wordpress/how-to-write-custom-wp-cli-commands-for-wordpress-automation/ https://docs.wpvip.com/how-tos/write-custom-wp-cli-commands/
CLI: https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-make-progress-bar/
You can use the --help option to learn about the options:
wp webp-express --help
. Displays the available commands
wp webp-express convert --help
. Displays the available options for the "convert" command.
A few examples:
wp webp-express convert
: Creates webp images for all unconverted images
wp webp-express convert --reconvert
: Also convert images that are already converted
wp webp-express convert themes
: Only images in the themes folder
wp webp-express convert --only-png
: Only the PNG images
wp webp-express convert --quality=50
: Use quality 50 (instead of what was entered in settings screen)
wp webp-express convert --quality=50
: Use quality 50 (instead of what was entered in settings screen)
wp webp-express flushwebp
: Remove all webp images
wp webp-express flushwebp --only-png
: Remove all webp images that are conversions of PNG images
I'm considering adding commands for viewing status, viewing conversion stats, generating the .htaccess files and modifying the settings. Please let me know if you need any of these or perhaps something else.
Very cool, thanks!
Just published (0.20.0)
Already completed by @ratnayake: https://github.com/rosell-dk/webp-express/pull/492
@vasikgreif created something very similar here, but with progress bar: https://wordpress.org/support/topic/wp-cli-suport-for-bulk-convert/#post-14561675
I think I'll go with the PR, though