PHP error Undefined array key – line 1680
-
I’m having troubles with a php error and cannot find where it goes wrong. Every images that is showed on our website generates an error. Can you help me out with this?
The error says:
PHP Warning: Undefined array key “file” in *** /public/wp-includes/media.php on line 1680″ while reading upstream.
Here is the full block of code on line 1680:
1679 // Bail early if an image has been inserted and later edited.
1680 if ( preg_match( ‘/-e[0-9]{13}/’, $image_meta[‘file’], $img_edit_hash ) &&
1681 strpos( wp_basename( $image_src ), $img_edit_hash[0] ) === false ) {
1682
1683 return $image;
1684 }
*Note: after updating to wordpress 6.2 the code above is in line 1686
Hello,
Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?
Regards
Hi, yes when I switch to s default theme (Twenty Twenty-Three) in this case, the issue is not there.
This error seems to be generated by this custom code https://monosnap.com/file/PIME0ThPySP3w6IYEFVjNtTeTCWOWH
You don’t see the error with the default theme because it doesn’t display this widget.
Kind Regards
Hi Artem,
That seems to be the issue yes. I will change the image. Thank you very much. We couldn’t find it ourselves.
Resolved now.
You are always welcome. Feel free to contact us if you have any further questions.
The topic ‘PHP error Undefined array key – line 1680’ is closed to new replies.