short array syntax

Can someone help me make this PHP 5.3 friendly

‘style="background-image: url(’.wp_get_attachment_image_src(get_sub_field(‘background’),‘full’)[0].’)"’ : ‘’; ?>>

< PHP 5.3 does not like the short array, I just need to temporarily make it work

Just asking, because pulling the array apart gets messy, but why not move the PHP version up to a more up-to-date version? You are currently dealing with a really old host setup if you are running 5.3.

old host not willing to update, if that the only option then so be it

Just hoping for a quick fix, to buy some time :slight_smile:

This WP Development link may work, but you better option is to go with a host that is at least partially updated. I wouldn’t expect you on 7.1, but 5.6 at a minimum.

Sorry, forgot to add the link in!

https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/

5.3 is HUNDREDS of releases behind. Get a new host.

Sponsor our Newsletter | Privacy Policy | Terms of Service