[WordPress] 外掛分享: EDD List File Names

首頁外掛目錄 › EDD List File Names
WordPress 外掛 EDD List File Names 的封面圖片
50+
安裝啟用
★★★★★
5/5 分(2 則評價)
4407 天前
最後更新
問題解決
WordPress 3.3+ v1.0.1 上架:2014-01-22

內容簡介

此外掛需要Easy Digital Downloads。

使用內建的[edd_file_names]簡碼,您可以列出下載文件的文件名稱(不是文件路徑)。此功能可用於向客戶展示在購買產品時包含哪些內容。該簡碼還可以使用兩個參數:標題和ID。使用ID,您可以從其他文章/頁面/下載中顯示下載文件的文件名稱。

簡碼的使用方式

使用有序列表基本列出當前下載

[edd_file_names]

列表上方用自訂標題

[edd_file_names title="Files Included"]

使用ID顯示下載文件。當您還在其他頁面/文章使用[purchase_link]簡碼時,此簡碼很有用

[edd_file_names id="123" title="Another download's files"]

修改HTML標記

此示例顯示如何修改HTML標記。標題已被替換為<h1>標記,並且列表現在是無序列表。複製並粘貼以下功能到您的子佈景主題的functions.php文件或自定義外掛中:

function sumobi_edd_list_file_names( $html, $title, $download_files ) {
ob_start();
if ( $download_files && is_array( $download_files ) ) : ?>

<?php if ( $title ) : ?>
<h1><?php echo $title; ?></h1>
<?php endif; ?>

<ul class="edd-file-names">
<?php foreach ( $download_files as $file ) : ?>
<li><?php echo $file['name']; ?></li>
<?php endforeach; ?>
</ul>

<?php endif;

$html = ob_get_clean();
return $html;
}
add_filter( 'edd_list_file_names', 'sumobi_edd_list_file_names', 10, 3 );

易數字下載的擴充功能

https://easydigitaldownloads.com/extensions/

易數字下載的技巧

http://sumobi.com/blog

保持最新的狀態

在Twitter上關注我
http://twitter.com/sumobi_

成為Facebook的粉絲
http://www.facebook.com/sumobicom

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「EDD List File Names」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin requires Easy Digital Downloads.
Using the included [edd_file_names] shortcode you’ll be able to list a download’s file names (not file paths). This is useful for showing customers what is included when they purchase your product. The shortcode also takes 2 parameters, title and ID. Using the ID you’re able to show a download’s file names from another post/page/download.
Shortcode usage
Basic listing of the current download in an ordered list
[edd_file_names]

Custom title above the list
[edd_file_names title="Files Included"]

Show the download’s files by using it’s ID. Useful when you are also using the [purchase_link] shortcode on another page/post
[edd_file_names id="123" title="Another download's files"]

Modifying the HTML markup
This example shows how you can modify the HTML markup. Heading has been replaced with an

tag, and the list is now an unordered list. Copy and paste the following function into your child theme’s functions.php or a custom plugin:
function sumobi_edd_list_file_names( $html, $title, $download_files ) {
ob_start();
if ( $download_files && is_array( $download_files ) ) : ?>

延伸相關外掛

文章
Filter
Apply Filters
Mastodon