內容簡介
這是一個 WordPress 外掛,不僅讓使用者輕鬆地將來自 YouTube、Vimeo、Yahoo Video 及 Soundcloud 的媒體嵌入到他們的文章中,同時也讓開發人員可以將其用作 WordPress 模板檔案的函數以嵌入自訂內容類型和其他篩選器的視訊。該外掛也帶有一個小工具,讓您可以輕鬆地在側邊欄中嵌入媒體。
目前此外掛支援 YouTube、Vimeo、Yahoo Video 及 Soundcloud。我們希望能夠很快新增更多線上媒體服務。
使用方式
使用者如何使用它?
要在文章或頁面中嵌入媒體,您只需要在您的文章或頁面內容中加入以下shortcode:
[media link=”http://www.youtube.com/watch?v=EojN6r2VSR4″]
您還可以通過在shortcode中添加寬度和高度參數,對您的媒體進行自訂大小:
[media width=”800″ height=”600″ link=”http://www.youtube.com/watch?v=EojN6r2VSR4″]
從版本1.3開始,您現在可以通過將容器設置為false(默認值為true)來刪除嵌入代碼周圍的容器:
[media container=”false” link=”http://www.youtube.com/watch?v=EojN6r2VSR4″]
開發者如何使用它?
別擔心,我們沒有忘記開發人員。
要在程式碼中的某個位置嵌入媒體,您只需在模板中加入以下函數:
<?php media_embed('http://www.youtube.com/watch?v=EojN6r2VSR4'); ?>
您還可以通過分別添加寬度和高度的引數,對媒體進行自訂大小:
<?php media_embed('http://www.youtube.com/watch?v=EojN6r2VSR4', 800, 600); ?>
從版本1.3開始,現在可以刪除嵌入代碼周圍的容器,您可以將容器設置為false(默認值為true):
<?php media_embed('http://www.youtube.com/watch?v=EojN6r2VSR4', 800, 600, false); ?>
或者,如果您不想設置寬度和高度,只需刪除容器:
<?php media_embed('http://www.youtube.com/watch?v=EojN6r2VSR4', '', '', false); ?>
外掛標籤
開發者團隊
原文外掛簡介
a WordPress plugin that would not only allow the user to easily embed media from YouTube, Vimeo, Yahoo Video and Soundcloud into their posts, but also allow us as developers to use it as a function in the our WordPress template files to embed videos in custom content types and other filters. The plugin also comes with a widget to allow you to easily embed media in your sidebar.
The plugin currently supports YouTube, Vimeo, Yahoo Video and Soundcloud. We hope to be able to add more online media services soon.
Usage
How do users use it?
To embed a piece of media in a post or page you simply need to add the following shortcode to you post or page content:
[media link=”http://www.youtube.com/watch?v=EojN6r2VSR4″]
You can also set a custom width and height to your media by adding the width and height parameters to the shortcode:
[media width=”800″ height=”600″ link=”http://www.youtube.com/watch?v=EojN6r2VSR4″]
As of version 1.3 you can now remove the container around the embed code by setting the container to false(default is true):
[media container=”false” link=”http://www.youtube.com/watch?v=EojN6r2VSR4″]
How do developers use it?
Don’t worry, we did not forget about the developers.
To embed a piece of media somewhere in the code you simply need to add the following function to the template:
You can also set a custom width and height to the media by adding arguments for width and height respectively:
As of version 1.3 it is now possible to remove the container around the embed code you can set the container to false(default is true):
OR if you don’t want to set the width and height and just remove the container:
