Abstract_WC_Order_Data_Store_CPT::should_suppress_transactional_email_dispatch
Checks whether a transactional email dispatch belongs to the restored order.
Метод класса: Abstract_WC_Order_Data_Store_CPT{}
Хуков нет.
Возвращает
true|false.
Использование
// private - только в коде основоного (родительского) класса $result = $this->should_suppress_transactional_email_dispatch( $action, $restored_order_id, $args ): bool;
- $action(строка) (обязательный)
- The action being dispatched.
- $restored_order_id(int) (обязательный)
- The ID of the order being restored.
- $args(массив) (обязательный)
- The runtime action arguments.
Список изменений
| С версии 10.9.0 | Введена. |
Код Abstract_WC_Order_Data_Store_CPT::should_suppress_transactional_email_dispatch() Abstract WC Order Data Store CPT::should suppress transactional email dispatch WC 11.0.1
private function should_suppress_transactional_email_dispatch( string $action, int $restored_order_id, array $args ): bool {
if ( 0 !== strpos( $action, 'woocommerce_order_status_' ) ) {
return false;
}
$order = $args[1] ?? null;
if ( $order instanceof WC_Order ) {
return $restored_order_id === $order->get_id();
}
$order_id = $args[0] ?? null;
return is_numeric( $order_id ) && $restored_order_id === (int) $order_id;
}