[WordPress] 外掛分享: EDD Hide Show Download

首頁外掛目錄 › EDD Hide Show Download
WordPress 外掛 EDD Hide Show Download 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
全新外掛
安裝啟用
尚無評分
1259 天前
最後更新
問題解決
WordPress 4.7+ PHP 5.4+ v0.0.1 上架:2022-08-15

內容簡介

透過這個外掛,您可以輕鬆地在前端顯示中隱藏或顯示您的 Easy Digital Downloads 產品/下載,只需點擊即可。

此外掛需要 Easy Digital Downloads。

它可以讓您:
1. 隱藏下載,使其不會出現在自訂文章類型存檔頁面、任何使用 [downloads] 短碼的地方或頁面模板上的任何自訂查詢中。
2. 防止直接存取下載,瀏覽器會重新導向使用者到網站的首頁。
3. 同時進行隱藏下載和防止直接進入下載的組合選項。

篩選器範例
範例篩選器可更改基於下載 ID 的重新導向方式。將此函數複製到您的子佈景主題 functions.php 或自訂插件

<?php code(function thsedd_custom_edd_hide_download_redirect( $url ) {
                //下載 ID 為 32
                if('32' == get_the_ID()){
                    $url ='http://easydigitaldownloads.com'; // 將使用者重新導向到另一個外部 URL
                }

                // 下載 ID 為 12
                if('12' == get_the_ID()){
                    $url = get_permalink('12'); // 重新導向到具有 ID 為 8 的另一個下載
                }

                // 返回新網址
                return $url;
            }
            add_filter('edd_thsedd_download_redirect','thsedd_custom_edd_hide_download_redirect');); ?>

篩選器範例可全局更改重新導向方式。將此函數複製到您的子佈景主題 functions.php 或自訂插件

<?php code(function thsedd_custom_edd_hide_download_redirect( $url ) {
                $url = get_permalink('12'); // 重新導向到另一個下載、文章或頁面

                return $url;
            }
            add_filter('edd_thsedd_download_redirect','thsedd_custom_edd_hide_download_redirect');); ?>

外掛標籤

開發者團隊

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

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

原文外掛簡介

With this plugin, you can easily hide or show your Easy Digital Downloads product/download from the frontend display with just a click.
This plugin requires Easy Digital Downloads.
It allows you to:
1. Hide a download so it doesn’t appear on the custom post type archive page, anywhere where the [downloads] shortcode is being used, or any custom query on a page template.
2. Prevent direct access to the download. The browser will redirect the user to the site’s homepage.
3. Do a combination of hiding the download and preventing direct access to it.
Filter example
Example filter of how you can change the redirect based on the download ID. Copy this function to your child theme’s functions.php or custom plugin

Example filter of how you can globally change the redirect. Copy this function to your child theme’s functions.php or custom plugin

延伸相關外掛

文章
Filter
Apply Filters
Mastodon