YouTube view count code in theme functions


#1

Hello, I have few lines of custom php code in theme functions for YouTube view count displayed on page
with shortcode. After installing this Donut plugin it stop working.

This is php code in functions.php

/* yt view count j.m. customized */

function youtube_view_count_shortcode($params)
{
$videoID = $params[‘id’];
$json = file_get_contents
(“https://www.googleapis.com/youtube/v3/videos?part=statistics&id=” . $videoID . “&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”);
$jsonData = json_decode($json);
$views = $jsonData->items[0]->statistics->viewCount;
return number_format($views);
}
/* yt vc end */

this is shortcode
[youtube_view_count id=“vulah6t8TJI”]

I would be grateful for any any suggestions. Thank you.