
內容簡介
使用這個外掛,您可以嵌入推文而不會影響使用者隱私和網站效能。此外掛可透過使用 Twitter 的 API 檢索資料,移除掉 Twitter 的腳本,與內建的 Tweet Gutenberg 區塊一起運作 (詳細內容)。
您可以選擇性地提供 Twitter 的 API 金鑰以顯示推文的讚數和轉推數,以及載入包含圖片和其他媒體的推文。
了解更多 | 查看原始碼
常見問題
推文無法載入
請確認您的 API 金鑰是否已正確設置,以及您是否使用了 Twitter API 的 v2 版本 (請參閱「入門指南」)。
我需要在處理推文後執行某個指令
您可以使用 tembeds_tweets_processed 事件。以下是以 jQuery 為例的程式碼:
$( document ).on( 'tembeds_tweets_processed', function(){
$( '.twitter-tweet' ).each( function(){
let $tweet = $( this );
// 在這裡可以對每個推文進行操作。
} );
} );
外掛標籤
開發者團隊
原文外掛簡介
Embed Tweets without compromising your users’ privacy and your site’s performance. This plugin works with the built-in Tweet Gutenberg block by removing Twitter’s script and using Twitter’s API to retrieve the data.
You can optionally provide Twitter API keys to show the number of likes and retweets and load images and other media in Tweets.
Learn more | View source
FAQ and Troubleshooting
Tweets are not loading
Please make sure your API keys are set up correctly and that you’re using the v2 of Twitter’s API. (See the Get Started section.)
I need to run a script after Tweets are processed
You can use the tembeds_tweets_processed event. Using jQuery as an example, you could do the following:
$( document ).on( 'tembeds_tweets_processed', function(){
$( '.twitter-tweet' ).each( function(){
let $tweet = $( this );
// Now you can do something with each Tweet.
} );
} );
