Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Media_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,18 @@ public function regenerate( $args, $assoc_args = array() ) {
}
}

$skip_delete = Utils\get_flag_value( $assoc_args, 'skip-delete' );
$only_missing = Utils\get_flag_value( $assoc_args, 'only-missing' );
$skip_delete = Utils\get_flag_value( $assoc_args, 'skip-delete', false );
$only_missing = Utils\get_flag_value( $assoc_args, 'only-missing', false );
if ( $only_missing ) {
$skip_delete = true;
}

$delete_unknown = Utils\get_flag_value( $assoc_args, 'delete-unknown' );
$delete_unknown = Utils\get_flag_value( $assoc_args, 'delete-unknown', false );
if ( $delete_unknown ) {
$skip_delete = false;
}

$update_attachment_refs = Utils\get_flag_value( $assoc_args, 'update-attachment-refs' );
$update_attachment_refs = Utils\get_flag_value( $assoc_args, 'update-attachment-refs', false );

$additional_mime_types = array();

Expand Down Expand Up @@ -316,7 +316,7 @@ public function prune( $args, $assoc_args = array() ) {
}
}

$remove_abandoned = Utils\get_flag_value( $assoc_args, 'remove-abandoned' );
$remove_abandoned = Utils\get_flag_value( $assoc_args, 'remove-abandoned', false );

if ( empty( $args ) ) {
if ( $image_sizes ) {
Expand Down Expand Up @@ -910,7 +910,7 @@ public function replace( $args, $assoc_args = array() ) {
$new_mime_type = $uploaded['type'];

// Delete old thumbnail files unless asked to skip.
if ( ! Utils\get_flag_value( $assoc_args, 'skip-delete' )
if ( ! Utils\get_flag_value( $assoc_args, 'skip-delete', false )
&& false !== $old_fullsizepath
&& is_array( $old_metadata )
) {
Expand Down Expand Up @@ -2055,7 +2055,7 @@ public function fix_orientation( $args, $assoc_args ) {
$images = $this->get_images( $args );
$posts = $images->posts;
$count = $images->post_count;
$dry_run = Utils\get_flag_value( $assoc_args, 'dry-run' );
$dry_run = Utils\get_flag_value( $assoc_args, 'dry-run', false );

if ( ! $count || ! is_array( $posts ) ) {
WP_CLI::error( 'No images found.' );
Expand Down
Loading