WC_Order_Data_Store_CPT::set_email_sent()
Stores information about whether email was sent.
Метод класса: WC_Order_Data_Store_CPT{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WC_Order_Data_Store_CPT = new WC_Order_Data_Store_CPT(); $WC_Order_Data_Store_CPT->set_email_sent( $order, $set );
- $order(WC_Order|int) (обязательный)
- Order ID or order object.
- $set(true|false) (обязательный)
- True or false.
Код WC_Order_Data_Store_CPT::set_email_sent() WC Order Data Store CPT::set email sent WC 9.4.2
public function set_email_sent( $order, $set ) { if ( $order instanceof WC_Order ) { $order->set_new_order_email_sent( $set ); } $order_id = WC_Order_Factory::get_order_id( $order ); $value = wc_bool_to_string( $set ); $value = 'yes' === $value ? 'true' : 'false'; // For backward compat, we store this as true|false string. update_post_meta( $order_id, '_new_order_email_sent', $value ); }