woocommerce_new_order_email_allows_resend хук-фильтрWC 5.0.0

Controls if new order emails can be resend multiple times.

Использование

add_filter( 'woocommerce_new_order_email_allows_resend', 'wp_kama_woocommerce_new_order_email_allows_resend_filter' );

/**
 * Function for `woocommerce_new_order_email_allows_resend` filter-hook.
 * 
 * @param bool $allows Defaults to false.
 *
 * @return bool
 */
function wp_kama_woocommerce_new_order_email_allows_resend_filter( $allows ){

	// filter...
	return $allows;
}
$allows(true|false)
Defaults to false.

Список изменений

С версии 5.0.0 Введена.

Где вызывается хук

WC_Email_New_Order::trigger()
woocommerce_new_order_email_allows_resend
woocommerce/includes/emails/class-wc-email-new-order.php 105
if ( 'true' === $email_already_sent && ! apply_filters( 'woocommerce_new_order_email_allows_resend', false ) ) {

Где используется хук в WooCommerce

woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php 114
add_filter( 'woocommerce_new_order_email_allows_resend', '__return_true' );
woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php 116
remove_filter( 'woocommerce_new_order_email_allows_resend', '__return_true' );