[wp-trac] [WordPress Trac] #64742: PHP 8.5: Incorrect array access in `wp_get_attachment_image_src`
WordPress Trac
noreply at wordpress.org
Thu Feb 26 22:45:59 UTC 2026
#64742: PHP 8.5: Incorrect array access in `wp_get_attachment_image_src`
-------------------------------+-----------------------------
Reporter: edent | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.9.1
Severity: minor | Keywords:
Focuses: php-compatibility |
-------------------------------+-----------------------------
Similar to #64295 and #63977
`Warning at /wp-
json/oembed/1.0/embed?url=https%3A%2F%2Fshkspr.mobi%2Fblog%2Fabout%2F&format=xml:
[2] Cannot use bool as array in /wp-includes/embed.php on line 742`
From https://github.com/WordPress/wordpress-
develop/blob/f041be2a79eb9694217d716da3bf6d53f63a2173/src/wp-
includes/embed.php#L742 :
{{{#!php
function get_oembed_response_data_rich( $data, $post, $width, $height ) {
[…]
list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) =
wp_get_attachment_image_src( $thumbnail_id, array( $width, 0 ) );
}}}
[https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/
wp_get_attachment_image_src()] returns `array|false` - but this only
expects an array.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64742>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list