Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Avoid DB hit unless $reassign is provided
  • Loading branch information
danielbachhuber authored Mar 5, 2024
commit 872693de0b9f5381153338d4bc35b1a8a2cba8bc
2 changes: 1 addition & 1 deletion src/User_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function delete( $args, $assoc_args ) {
WP_CLI::error( 'Reassigning content to a different user is not supported on multisite.' );
}

$is_reassign_valid = ( false === get_userdata( $reassign ) ) ? false : true;
$is_reassign_valid = ( $reassign && false === get_userdata( $reassign ) ) ? false : true;

if ( ! $reassign ) {
WP_CLI::confirm( '--reassign parameter not passed. All associated posts will be deleted. Proceed?', $assoc_args );
Expand Down