QuestionsHow to check media upload error in WooCommerce
mmclara clara asked 2 weeks ago

is_wp_error() function give you authority to find error in media upload. Please see below example:

if ( is_wp_error( $attachment_id ) ) {
$errors = $attachment_id->get_error_messages();
foreach( $errors as $error ){
echo $error;
}
echo ‘There was an error uploading the image’;

}

Your Answer
Login
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.