WC_Coupon_Data_Store_CPT::refresh_coupon_data()
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() WC Coupon Data Store CPT::refresh coupon data code WC 9.4.2
private function refresh_coupon_data( &$coupon ) { wp_cache_delete( $coupon->get_meta_cache_key(), 'coupons' ); wp_cache_delete( $coupon->get_id(), 'post_meta' ); }