'Cannot use object of type stdClass as array' using Wordpress 'Cannot use object of type stdClass as array' using Wordpress wordpress wordpress

'Cannot use object of type stdClass as array' using Wordpress


Note that the array contains objects (instances of stdClass), not other arrays. So the syntax is:

$tag[0]->slug


Another option should be to explicitly cast $tag[0] into an array:

$t = (array)$tag[0];$t["slug"] = ...

Can't get it to work though