PHP8 dislikes $dislikeCount
-
YouTube has dropped the dislikes from their API, so when fetching the stats, PHP8 can’t find
$JSON_Data->items[0]->statistics->dislikeCountand cries out with:
Undefined property: stdClass::$dislikeCountDue to this, all stats for all videos break.
I’ve temporarily fixed it with this simple code change in
youtube-showcase-professional/includes/youtube-functions.php:595
$youtube_stats['video_dislike_count'] = $JSON_Data->items[0]->statistics->dislikeCount ?? 0;For older PHP versions below PHP7, it will require an
issetinstead.I’m using the Pro version 4.9.0 by the way.
The topic ‘PHP8 dislikes $dislikeCount’ is closed to new replies.