私はWooCommerceの高度な通知を使用して電子メールを送信しています.v1.2.10ではトリガーを変更できるようにフィルタが追加されていますが、WooCommerceの高度な通知で電子メール通知トリガーを設定する
は、フィルタフックは次のようになります。
if (apply_filters('woocommerce_advanced_notifications_multiple_statuses_trigger', true)) {
add_action('woocommerce_order_status_pending_to_processing', array($this, 'new_order'));
add_action('woocommerce_order_status_pending_to_completed', array($this, 'new_order'));
add_action('woocommerce_order_status_pending_to_on-hold', array($this, 'new_order'));
add_action('woocommerce_order_status_failed_to_processing', array($this, 'new_order'));
add_action('woocommerce_order_status_failed_to_completed', array($this, 'new_order'));
} else {
add_action('woocommerce_order_status_completed', array($this, 'new_order'));
}
私は
が、私は私自身のトリガーを追加できるようにしたいと思います(例えばprocessing_to_completed)を達成し、削除したいと思いますどのような他のトリガー(例えば、pending_to_on-hold)。私は
私はフィルタの詳細を理解するために、この(http://docs.presscustomizr.com/article/26-wordpress-actions-filters-and-hooks-a-guide-for-non-developers)ガイドを使用するんだと、私はこのコードを追加することで使用されているif文の一部変更することができることを働いてきた
私のfunctions.php
apply_filters('woocommerce_advanced_notifications_multiple_statuses_trigger', false);
しかし、私は新しいトリガーを追加する方法を見ることができません。変数をフィルターに戻す方法がわかりません。
私は正しい方向にポイントを感謝したいと思います。ありがとう、ローラ。
あなたは何を目指していますか?複数のステータストリガーを削除しますか?または、追加のものを追加しますか? – helgatheviking
こんにちは。自分のトリガーを追加(例:processing_to_completed)し、他のトリガー(pending_to_on-holdなど)を削除したいと考えています。私は明確にするために質問を編集しました。 – LauraTheExplorer
'add_filter( 'woocommerce_advanced_notifications_multiple_statuses_trigger'、 '__return_false');'は、複数のステータストリガを無効にし、 'woocommerce_order_status_completed'トリガを残すだけです。 – helgatheviking