From 467777bf13c2ef6b2544c44604af68f9fc9403a1 Mon Sep 17 00:00:00 2001 From: deepench Date: Thu, 1 Oct 2026 10:08:45 +0545 Subject: [PATCH] Fix array offset warning in the slider when the image is not in the media library attachment_url_to_postid() returns 0 for a slide image that isn't in the media library, so wp_get_attachment_image_src() returns false and the width/height were read from it unguarded. They are now only printed when the image data exists; the image itself still renders from its URL. Verified live: a slide with an external image URL logged two "Trying to access array offset on false" warnings before and none after, and the image still renders. --- inc/header-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/header-functions.php b/inc/header-functions.php index 67d9eb2..67c6038 100644 --- a/inc/header-functions.php +++ b/inc/header-functions.php @@ -91,7 +91,7 @@ function accelerate_featured_image_slider() { ?>
- <?php echo esc_attr( $image_alt_text ); ?> + alt="" src="">