WC_Order_Data_Store_CPT::set_email_sent()
Stores information about whether email was sent.
Method of the class: WC_Order_Data_Store_CPT{}
No Hooks.
Return
null
. Nothing (null).
Usage
$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) (required)
- Order ID or order object.
- $set(true|false) (required)
- True or false.
WC_Order_Data_Store_CPT::set_email_sent() WC Order Data Store CPT::set email sent code WC 9.3.3
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 ); }