I’ve been using the Edin theme for several months on PHP 5.6 without any problems.
Just prior to upgrading Edin, I upgraded to WordPress to 4.8.1 and the update process timed out while incomplete so I had to upload a fresh WordPress.
I had also prior updated a few other plugins but no problems after doing that. I didn’t add any new plugins or activate/deactivate any prior to experiencing this problem.
Jetpack was installed and active but I haven’t configured or used it. I’ve now deleted it.
I’m confused. As a syntax error would mean a problem with the code itself, not a runtime error caused by other code, I don’t know what else to do and I’ve no idea why it is calling out this line of code as a syntax error.
The full, original function as taken from the code on my site is:
function edin_get_attachment_image_src( $post_id, $post_thumbnail_id, $size ) {
if ( function_exists( 'jetpack_featured_images_fallback_get_image_src' ) ) {
return jetpack_featured_images_fallback_get_image_src( $post_id, $post_thumbnail_id, $size );
} else {
return wp_get_attachment_image_src( $post_thumbnail_id, $size )[0];
}
}
When I remove the [0] it works and when I re-add it, I get the syntax error.
I’m now using PHP 7.
As long as I leave the [0] out it works, but I’d prefer to find out what the problem is.
Any idea where I should go next?
Thanks.