內容簡介
WP Discord Post 是 WordPress 的一個免費外掛程式,使用 Discord 機器人和 Webhook URL,當新文章在您的網誌上發佈時,可以寫入您所選擇的 Discord 伺服器中的特定頻道。
您可以前往「設定 > WP Discord Post」並填寫所有詳細資料進行配置。所有欄位都是必填的,點選欄位說明中的「了解更多」鏈結可瞭解如何取得所需的資料。
與聯絡表單兼容
WP Discord Post 與 Contact Form 7、Jetpack Contact Form 和 Gravity Forms 相容,於每次通過電子郵件發送之前將每個表單的內容發送到您的 Discord。
與 WooCommerce 相容
WP Discord Post 也與 WooCommerce 相容,每當在您的商店創建新訂單或新增產品目錄時,會向 Discord 發送新的訊息。
與任何自訂文章類型相容
WP Discord Post 支援任何文章類型,只需要一點自定義程式碼。如果您想要為您的自訂文章類型發送一條消息,請將以下程式碼添加到您的 functions.php 檔案中 wp-content/themes/your-child-theme-name/:
add_action( 'publish_{post_type}', array( WP_Discord_Post::instance()->post, 'send' ), 10, 2 );
請確保將 {post_type} 替換為您想要使用的文章類型的 slug。例如,如果您註冊了一個名稱為 book 的文章類型,您將使用:
add_action( 'publish_book', array( WP_Discord_Post::instance()->post, 'send' ), 10, 2 );
隱私資訊
此外掛程式會將私人使用者資料發送到 Discord。根據您使用的功能,會發送不同的資料:
文章:作者名稱
聯絡表單:通過表單收集的任何使用者資料
訂單:客戶和訂單詳細資料
一旦發送了資料,它們就在 Discord 的控制下,本外掛程式不能從其伺服器上移除這些資料。請在 https://discordapp.com/privacy 瞭解更多 Discord 的隱私政策。
開發者資源
WP Discord Post 附帶了一些勾子可用於自訂外掛程式的操作方式。以下是這些勾子的列表:
過濾器
wp_discord_post_post_content
wp_discord_post_post_embed
wp_discord_post_embed_image_size
wp_discord_post_woocommerce_order_content
wp_discord_post_allowed_order_statuses
wp_discord_post_product_embed
wp_discord_post_order_embed
wp_discord_post_{context}_webhook_url
wp_discord_post_webhook_url
wp_discord_post_request_body_args
wp_discord_post_request_args
wp_discord_post_process_old_posts
wp_discord_post_is_new_post
wp_discord_post_meme_tag
wp_discord_post_meme_rating
wp_discord_post_embed_enabled
操作
wp_discord_post_init
wp_discord_post_before_request
wp_discord_post_after_request
路線圖
每篇文章單獨提及 @everyone 的選項
文章評論的 Discord 通知
WooCommerce 產品更新時(庫存和銷售更新)的 Discord 通知
Discord 的 WooCommerce 銷售報告
MailCh
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
WP Discord Post is a free plugin for WordPress that uses a Discord bot and Webhook URL to write in your desired channel in your Discord server whenever a new post is published on your blog.
You can configure it by going to Settings > WP Discord Post and filling in all the details. The fields are all required. Click on the links “Learn more” in the description of the fields to learn how to get the necessary data.
Compatible with contact forms
WP Discord Post is compatible with Contact Form 7, Jetpack Contact Form, and Gravity Forms sending the content of each form to your Discord before it is sent via email as well.
Compatible with WooCommerce
WP Discord Post is also compatible with WooCommerce, sending a new message to Discord every time a new order is created on your shop, or when a new product is added to the catalog.
Compatible with any custom post type
WP Discord Post supports any post type, with a bit of custom code. If you want to send a message for your custom post type add this code to your functions.php file in wp-content/themes/your-child-theme-name/:
add_action( 'publish_{post_type}', array( WP_Discord_Post::instance()->post, 'send' ), 10, 2 );
Make sure to replace {post_type} with the slug of the post type that you want to use, for example if you registered a post type book you would use:
add_action( 'publish_book', array( WP_Discord_Post::instance()->post, 'send' ), 10, 2 );
Privacy Info
This plugin sends private user data to Discord. Different data are sent based on what features you use:
Posts: Author name
Contact Forms: Any user data collected via the form
Orders: Customer and order details
Once the data are sent they are under Discord’s control and the plugin cannot remove them from their servers.
Learn more about Discord’s privacy policy at https://discordapp.com/privacy.
Developers Resources
WP Discord Post comes with some hooks that you can use to customize how the plugin works. Here is a list of them:
Filters
wp_discord_post_post_content
wp_discord_post_post_embed
wp_discord_post_embed_image_size
wp_discord_post_woocommerce_order_content
wp_discord_post_allowed_order_statuses
wp_discord_post_product_embed
wp_discord_post_order_embed
wp_discord_post_{context}_webhook_url
wp_discord_post_webhook_url
wp_discord_post_request_body_args
wp_discord_post_request_args
wp_discord_post_process_old_posts
wp_discord_post_is_new_post
wp_discord_post_meme_tag
wp_discord_post_meme_rating
wp_discord_post_embed_enabled
Actions
wp_discord_post_init
wp_discord_post_before_request
wp_discord_post_after_request
Roadmap
Option to mention @everyone on each post singularly
Discord notification for post comments
Discord notification when updating WooCommerce products (stock and sales updates)
Sales reports for WooCommerce in Discord
Discord notification on newsletter signup for MailChimp (TBC)
Compatibility with Yoast SEO and OpenGraph
Compatibility with WooCommerce Subscriptions
Compatibility with WooCommerce Memberships
More ideas? Tell me in the support forum
