內容簡介
使用這個外掛,您可以將媒體(包括自訂文章類型)添加到文章和頁面中,以快速且輕鬆地產生您內容的下載清單。
功能包括:
簡單地對可下載媒體進行每篇文章管理
使用簡潔易懂的 WordPress 媒體畫面來上傳或添加檔案
使用單個 shortcode,[pamd],將下載項目添加到您的內容中
進階使用者可以直接在其佈景主題中調用功能來實現除文章內容以外的下載區域
進階使用
如果您希望在主題中使用媒體下載,您可以按照以下方式直接調用 get_downloads() 函數:
$pamd->get_downloads($postID, $echo, $return_format, $target)
所有參數都是可選的,如果沒有找到任何下載,該函數將返回 false。以下參數將控制以下內容:
$postID 整數
您希望獲取的文章的 ID,如果未提供,將使用循環中的 ID
$echo 布林值
是否將內容輸出
$return_format 字串
清單應該以什麼格式返回,預設為無序清單
array 返回媒體的陣列
table 返回媒體的表格
pamd(預設)以無序清單返回媒體
$target 字串
如果您正在返回表格或使用預設行為,則這個屬性將決定連結的目標屬性
外掛標籤
開發者團隊
② 後台搜尋「Post Attached Media Downloads」→ 直接安裝(推薦)
原文外掛簡介
Add media to posts and pages (even Custom Post Types!) to quickly and easily generate download lists for your content.
Features include
Simple per-post management of downloadable media
Use the familiar WordPress media screen to upload or add files
Use a single shortcode, [pamd], to add downloads to your content
Advanced users may call functions directly in their themes to implement download areas outside the post content
Advanced use
If you wish to make use of media downloads in your theme, you can call the get_downloads() function directly in the following way;
$pamd->get_downloads( $postID, $echo, $return_format, $target )
All parameters are optional, and if no downloads are found the function will return false. The parameters control the following;
$postID integer
The ID of the post you wish to fetch, if none is provided the id form The Loop will be used
$echo boolean
Should the content be echoed or returned
$return_format string
What format should the list be returned in, the default is an unordered list
array returns an array of the media
table returns a table with the media
pamd (default) returns an unordered list with the media
$target string
This attribute is only used if you are returning a table or the default behavior is left, and will determine the target attribute of the link
