內容簡介
新增簡碼以顯示 YouTube 頻道的訂閱者和視頻觀看次數。使用這兩種簡碼都需要 YouTube 頻道 ID 和 YouTube API 金鑰。
出於性能原因,數據每 12 小時刷新一次。這可以通過“timeout”參數(以小時為單位的值)進行修改。
以下是簡碼:
youtube_views_count – 用於頻道視頻觀看次數
youtube_subscribers_count – 用於頻道訂閱者計數
以下是參數:
id – YouTube 頻道 ID(如何獲取 YouTube 頻道 ID?https://support.google.com/youtube/answer/3250431?hl=en)
key – 瀏覽器 YouTube API 金鑰(如何獲取 YouTube API 金鑰?https://developers.google.com/youtube/registering_an_application#Create_API_Keys)
timeout – 緩存失效時間(以小時為單位的值)/默認為 12 小時/
例如:
[youtube_views_count id=’YOUR_CHANNEL_ID’ key=’YOUR_API_KEY’]
[youtube_views_count id=’YOUR_CHANNEL_ID’ key=’YOUR_API_KEY’ timeout=’1′]
外掛標籤
開發者團隊
原文外掛簡介
Adds shortcodes to show YouTube channel’s subscribers and video views count. For both shortcodes YouTube Channel ID and YouTube API Key is needed.
For performance reasons the data is refreshed once every 12 hours. This can be modified with “timeout” parameter (value in hours).
Shortcodes are as follows:
youtube_views_count – for channel video views count
youtube_subscribers_count – for channel subscribers count
Parameters are as follows:
id – YouTube channel ID (How to get YouTube channel ID? https://support.google.com/youtube/answer/3250431?hl=en)
key – YouTube API key for browser (How to get YouTube API key? https://developers.google.com/youtube/registering_an_application#Create_API_Keys)
timeout – cache timeout (value in hours) /default is 12 hours/
For example:
[youtube_views_count id=’YOUR_CHANNEL_ID’ key=’YOUR_API_KEY’]
[youtube_views_count id=’YOUR_CHANNEL_ID’ key=’YOUR_API_KEY’ timeout=’1′]
