WC_Coupon_Data_Store_CPT::refresh_coupon_data()privateWC 1.0

This function clears coupon data from the WP cache after certain operations which, for performance reasons, are done via SQL queries.

Method of the class: WC_Coupon_Data_Store_CPT{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->refresh_coupon_data( $coupon );
$coupon(\WC_Coupon) (required) (passed by reference — &)
The coupon object.

WC_Coupon_Data_Store_CPT::refresh_coupon_data() code WC 8.7.0

private function refresh_coupon_data( &$coupon ) {
	wp_cache_delete( $coupon->get_meta_cache_key(), 'coupons' );
	wp_cache_delete( $coupon->get_id(), 'post_meta' );
}