There is conditional of is_wp_error() for $metadata which is output of wp_generate_attachment_metadata(). Since this function always return an array, my VSCode is flagging as error. Not sure about the background of the code. So mentioning here as an issue.
Bug Report
Describe the current, buggy behavior
Line 627 : https://github.com/wp-cli/media-command/blob/main/src/Media_Command.php#L627
There is conditional of is_wp_error() for
$metadata
which is output ofwp_generate_attachment_metadata()
. Since this function always return an array, my VSCode is flagging as error. Not sure about the background of the code. So mentioning here as an issue.Ref: https://developer.wordpress.org/reference/functions/wp_generate_attachment_metadata/