• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

「oEmbed」の版間の差分

提供: WordPress Codex 日本語版
移動先: 案内検索
(en:Embeds 15:16, 21 December 2009 Otto42 版を翻訳用にコピー)
 
(リンク調整等)
1行目: 1行目:
 +
{{NeedTrans}}
 +
{{Rename|E}}
 
__TOC__
 
__TOC__
 
Starting with [[Version 2.9|WordPress 2.9]], it's super easy to embed videos, images, and other content into your WordPress site.
 
Starting with [[Version 2.9|WordPress 2.9]], it's super easy to embed videos, images, and other content into your WordPress site.
53行目: 55行目:
 
=== Adding Support For An oEmbed-Enabled Site ===
 
=== Adding Support For An oEmbed-Enabled Site ===
  
If a site supports oEmbed, you'll want to call <code>[[Function Reference/wp_oembed_add_provider|wp_oembed_add_provider()]]</code> to add the site and URL format to the internal whitelist.
+
If a site supports oEmbed, you'll want to call <code>[[関数リファレンス/wp_oembed_add_provider|wp_oembed_add_provider()]]</code>/[[:en:Function Reference/wp_oembed_add_provider|en]] to add the site and URL format to the internal whitelist.
  
 
=== Adding Support For A Non-oEmbed Site ===
 
=== Adding Support For A Non-oEmbed Site ===
  
You'll need to register a handler using <code>[[Function Reference/wp_embed_register_handler|wp_embed_register_handler()]]</code> and provide a callback function that generates the HTML.
+
You'll need to register a handler using <code>[[関数リファレンス/wp_embed_register_handler|wp_embed_register_handler()]]</code>/[[:en:Function Reference/wp_embed_register_handler|en]] and provide a callback function that generates the HTML.
  
 
== What About oEmbed Discovery? ==
 
== What About oEmbed Discovery? ==
70行目: 72行目:
 
* [http://www.webmonkey.com/tutorial/Get_Started_With_OEmbed Webmonkey guide to oEmbed]
 
* [http://www.webmonkey.com/tutorial/Get_Started_With_OEmbed Webmonkey guide to oEmbed]
 
* [http://oembed.com/ Official oEmbed website] (technical details of the spec)
 
* [http://oembed.com/ Official oEmbed website] (technical details of the spec)
 +
 +
{{Stub}}
  
 
{{原文|Embeds|81260}}<!-- 15:16, 21 December 2009 Otto42 版 -->
 
{{原文|Embeds|81260}}<!-- 15:16, 21 December 2009 Otto42 版 -->
  
[[Category:Advanced Topics]]
+
<!-- {{DEFAULTSORT:}}ページ名日本語にしたら書く -->
{{Copyedit}}
+
[[Category:上級トピック]]
 +
[[Category:wp2.9]]
  
 
[[en:Embeds]]
 
[[en:Embeds]]

2010年1月10日 (日) 16:16時点における版

このページ「oEmbed」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

ページ名検討中: このページ名「oEmbed」について改名が提案されています。ご意見をお寄せください。

Starting with WordPress 2.9, it's super easy to embed videos, images, and other content into your WordPress site.

In A Nutshell

All you need to do to embed something into a post or page is to post the URL to it into your content area. Make sure that the URL is on its own line and not hyperlinked (clickable when viewing the post).

For example:

Check out this cool video:

http://www.youtube.com/watch?v=nTDNLUzjkpg

That was a cool video.

WordPress will automatically turn that into a YouTube embed when the post is viewed.

You can also opt to wrap the URL in the [embed] shortcode. It will accomplish the same effect, but does not require the URL to be on its own line.

oEmbed

The easy embedding feature is mostly powered by oEmbed, a protocol for site A (such as your blog) to ask site B (such as YouTube) for the HTML needed to embed content (such as a video) from site B.

oEmbed was designed to avoid having to copy and paste HTML from the site hosting the media you wish to embed. It supports videos, images, text, and more.

Can I Use Any URL With This?

Not by default, no. WordPress will only embed URLs matching an internal whitelist. This is for security purposes.

Okay, So What Sites Can I Embed From?

You can use all of these:

How Can I Add Support For More Websites?

Adding support for an additional website depends on whether the site supports oEmbed or not.

Adding Support For An oEmbed-Enabled Site

If a site supports oEmbed, you'll want to call wp_oembed_add_provider()/en to add the site and URL format to the internal whitelist.

Adding Support For A Non-oEmbed Site

You'll need to register a handler using wp_embed_register_handler()/en and provide a callback function that generates the HTML.

What About oEmbed Discovery?

The oEmbed implementation in WordPress has discovery disabled. By default, you can only embed from websites that are listed on the internal whitelist. This is to prevent accidental embedding from malicious websites.

However if you feel you are knowledgeable enough to avoid this, you can give unfiltered_html users (Administrators and Editors) the ability to embed from websites that have oEmbed discovery tags in their <head>. You merely need to install this plugin.

External Resources

このページ「oEmbed」はまだ書きかけで、情報が不足しています。続きを書いて WordPress を手助けしましょう.


最新英語版: WordPress Codex » Embeds最新版との差分