woocommerce_order_email_verification_grace_period
Controls the grace period within which we do not require any sort of email verification step before rendering the 'order received' or 'order pay' pages.
To eliminate the grace period, set to zero (or to a negative value). Note that this filter is not invoked at all if email verification is deemed to be unnecessary (in other words, it cannot be used to force verification in all cases).
Использование
add_filter( 'woocommerce_order_email_verification_grace_period', 'wp_kama_woocommerce_order_email_verification_grace_period_filter', 10, 3 ); /** * Function for `woocommerce_order_email_verification_grace_period` filter-hook. * * @param int $grace_period Time in seconds after an order is placed before email verification may be required. * @param WC_Order $that The order for which this grace period is being assessed. * @param string $context Indicates the context in which we might verify the email address. Typically 'order-pay' or 'order-received'. * * @return int */ function wp_kama_woocommerce_order_email_verification_grace_period_filter( $grace_period, $that, $context ){ // filter... return $grace_period; }
- $grace_period(int)
- Time in seconds after an order is placed before email verification may be required.
- $that(WC_Order)
- The order for which this grace period is being assessed.
- $context(строка)
- Indicates the context in which we might verify the email address. Typically 'order-pay' or 'order-received'.
Список изменений
С версии 8.0.0 | Введена. |
Где вызывается хук
woocommerce_order_email_verification_grace_period
woocommerce_order_email_verification_grace_period
woocommerce/src/Internal/Utilities/Users.php 67
$verification_grace_period = (int) apply_filters( 'woocommerce_order_email_verification_grace_period', 10 * MINUTE_IN_SECONDS, $order, $context );
woocommerce/src/Blocks/BlockTypes/OrderConfirmation/AbstractOrderConfirmationBlock.php 175
$verification_grace_period = (int) apply_filters( 'woocommerce_order_email_verification_grace_period', 10 * MINUTE_IN_SECONDS, $order, 'order-received' );