/**
* Regenerate thumbnail(s)
*
- * @synopsis [--id=<id>]
+ * @synopsis [--id=<id>] [--yes]
* props @benmay & @Viper007Bond
*/
function regenerate( $args, $assoc_args = array() ) {
global $wpdb;
$vars = wp_parse_args( $assoc_args, array(
- 'id' => false,
+ 'id' => false
) );
extract($vars, EXTR_SKIP);
+ WP_CLI::confirm('Do you realy want to regenerate all images?', $assoc_args);
+
$where_clause = ( $id ) ? "AND ID = $id" : '';
if ( !$images = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' $where_clause AND post_mime_type LIKE 'image/%' ORDER BY ID DESC" ) ) {