サイトのトップへ戻る

Twitter 開発者 ドキュメント日本語訳

埋め込み型動画

WordPress 用Twitterプラグインは 、twitter_videoWordPress ショートコードを通して Twitter 動画埋め込み をサポートしています。 ショートコードをあなたのWordPress の投稿に追加することで、埋め込み動画をWordPress の投稿に追加します。

Example:

このクールな動画を見てくれよ:

[twitter_video id="560070183650213889"]

これはクールな動画だ。

ショートコードの埋め込み結果:



サポートされているショートコードパラメータ

id 必須

希望するツイートの数値型 ID 。

サンプル値: 560070183650213889

status 任意

動画再生の下隅にあるツイッターバードのロゴを選択した時に、ツイートをオーバレイ表示するのではなくツイートURLへ直接送るには、false0nooffを設定します。

サンプル値: false



フィルタを使ったサイト全体のカスタマイズ

WordPress フィルターshortcode_atts_twitter_videoに渡された連想配列にしたがって動作することで、ウェブサイトはサイト全体のTwitter動画に関する設定を設定できます。 このフィルターにしたがって動作するFunctions では、statusキーに関連する値を変更する場合にはboolean 型を設定しなければなりません。

例:

/**
 * Always hide status overlay
 *
 * @param array $options parsed options with defaults applied
 * @param array $defaults default values of an embedded video
 * @param array $attributes user-defined shortcode attributes
 *
 * @return array options array with our customization applied
 */
function twitter_video_custom_options( $options, $defaults, $attributes )
{
  $options['status'] = false;
  return $options;
}
add_filter( 'shortcode_atts_twitter_video', 'twitter_video_custom_options', 10, 3 );