Fatal error: Cannot use object of type WP_Query as array
-
Hi guys. I noticed this error at the bottom of one of my clients’ sites at the bottom of the page (probably coming from
wp_footer) after the latest plugin update a few days ago.
The line in question is part of thew3_detect_post_id()function, defined in the fileinc/define.php, and reads:return $posts[0]->ID;Since
$postsholds a WP_Query object, if you are trying to check if posts exists, shouldn’t it read:return $posts->posts[0]->ID;?
Thanks for your help.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Fatal error: Cannot use object of type WP_Query as array’ is closed to new replies.