Title: Twitter Cards
Author: Niall Kennedy
Published: <strong>2012年6月17日</strong>
Last modified: 2013年4月3日

---

プラグインを検索

このプラグインは **WordPress の最新3回のメジャーリリースに対してテストされていま
せん**。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress
で使用した場合は互換性の問題が発生する可能性があります。

![](https://s.w.org/plugins/geopattern-icon/twitter-cards.svg)

# Twitter Cards

 作者: [Niall Kennedy](https://profiles.wordpress.org/niallkennedy/)

[ダウンロード](https://downloads.wordpress.org/plugin/twitter-cards.1.0.5.zip)

 * [詳細](https://ja.wordpress.org/plugins/twitter-cards/#description)
 * [レビュー](https://ja.wordpress.org/plugins/twitter-cards/#reviews)
 * [開発](https://ja.wordpress.org/plugins/twitter-cards/#developers)

 [サポート](https://wordpress.org/support/plugin/twitter-cards/)

## 説明

Generate inline content previews on Twitter.com and Twitter clients by including
[Twitter Card](https://dev.twitter.com/docs/cards) HTML meta elements for individual
posts.

All cards are a Twitter Card summary by default. Tap into the `twitter_card_properties`
filter to reference the Twitter accounts of your site or author.

Test your site’s Twitter Card display through [Twitter’s card preview tool](https://dev.twitter.com/docs/cards/preview).

### Filters

 * `twitter_cards_properties` – act on an array of properties before they are output
   to the page
 * `twitter_cards_htmlxml` – override the default treatment of `html` with `xml`.
   XML will self-close the meta void element ( “” vs. “” )

## スクリーンショット

[⌊Twitter Card display on desktop⌉⌊Twitter Card display on desktop⌉[

Twitter Card display on desktop

[⌊Twitter Card display on mobile⌉⌊Twitter Card display on mobile⌉[

Twitter Card display on mobile

## FAQ

  Why don’t you support feature X?

I wrote this plugin for my own site, [NiallKennedy.com](http://www.niallkennedy.com/),
added some slight flexibility through filters, and released the plugin on GitHub
as [a PHP library](https://github.com/niallkennedy/twitter-cards-php) with [a WordPress plugin wrapper](https://github.com/niallkennedy/twitter-cards).
I use summary cards for my site’s articles. If you would like to add better support
for photos, galleries, videos, apps, or products exposed to Twitter you can fork
my work and optionally send some code in a pull request.

 How do I add my Twitter account?

First you need to hook into the filter from code in your theme or site plugin(s).
You can add this code to your theme’s `functions.php` file or create a new file 
in `wp-content/mu-plugins/twitter-cards.php` or something similar.

    ```
    add_filter( 'twitter_cards_properties', 'twitter_custom' );
    ```

Next you need to modify the array passed to the filter with your own values.

    ```
    function twitter_custom( $twitter_card ) {
        if ( is_array( $twitter_card ) ) {
            $twitter_card['creator'] = '@niall';
            $twitter_card['creator:id'] = '1085';
        }
        return $twitter_card;
    }
    ```

The values generated by the plugin are passed to your new function for manipulation
before output.

The Twitter API function users/show is a good way to lookup your account information.
Copy the `screen_name` and `id_str` to `creator` and `creator:id` array values respectively
in your filter function referenced above. https://api.twitter.com/1/users/show.json?
screen_name=niall

Your Twitter screenname may change but your Twitter ID will remain the same. Grab
both while you are setting up your site to provide Twitter with the best data.

 You forgot to include a trailing slash on meta elements

The plugin outputs HTML-style void elements without a trailing slash by default.
Add XML-style trailing slashes by returning a value of `xml` on the `twitter_cards_htmlxml`
filter.

## 評価

このプラグインにはレビューがありません。

## 貢献者と開発者

Twitter Cards はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献
しています。

貢献者

 *   [ Niall Kennedy ](https://profiles.wordpress.org/niallkennedy/)

[“Twitter Cards” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/twitter-cards)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/twitter-cards/)するか、
[SVN リポジトリ](https://plugins.svn.wordpress.org/twitter-cards/)をチェックする
か、[開発ログ](https://plugins.trac.wordpress.org/log/twitter-cards/)を [RSS](https://plugins.trac.wordpress.org/log/twitter-cards/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

#### 1.0.5

 * Update Twitter Cards PHP library to support extending the plugin for new app,
   gallery, or product Twitter Card types.

#### 1.0.4

 * Treat post format of “image” as a Twitter photo card.

#### 1.0.3

 * Simplify the description generator. Based on the Open Graph protocol description
   generator in the Facebook plugin.
 * Update bundled version of Twitter Cards PHP, fixing description property treated
   as a required property for photo card type.

#### 1.0.2

 * Change attribute from value to content to match current Twitter documentation.

#### 1.0.1

 * Improve automatic excerpt generator and scrubber

#### 1.0

 * Initial release

## メタ

 *  バージョン **1.0.5**
 *  最終更新日 **14年前**
 *  有効インストール数 **200+**
 *  WordPress バージョン ** 3.3またはそれ以降 **
 *  検証済み最新バージョン: **3.5.2**
 *  言語
 * [English (US)](https://wordpress.org/plugins/twitter-cards/)
 * タグ
 * [semantic markup](https://ja.wordpress.org/plugins/tags/semantic-markup/)[twitter](https://ja.wordpress.org/plugins/tags/twitter/)
   [twitter cards](https://ja.wordpress.org/plugins/tags/twitter-cards/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/twitter-cards/advanced/)

## 評価

 5つ星中4.5つ星

 *  [  1 5-星レビュー     ](https://wordpress.org/support/plugin/twitter-cards/reviews/?filter=5)
 *  [  1 4-星レビュー     ](https://wordpress.org/support/plugin/twitter-cards/reviews/?filter=4)
 *  [  0 3-星レビュー     ](https://wordpress.org/support/plugin/twitter-cards/reviews/?filter=3)
 *  [  0 2-星レビュー     ](https://wordpress.org/support/plugin/twitter-cards/reviews/?filter=2)
 *  [  0 1-星レビュー     ](https://wordpress.org/support/plugin/twitter-cards/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/twitter-cards/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/twitter-cards/reviews/)

## 貢献者

 *   [ Niall Kennedy ](https://profiles.wordpress.org/niallkennedy/)

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/twitter-cards/)