Advertisement
verygoodplugins

Untitled

Dec 12th, 2024 (edited)
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. add_action( 'woocommerce_subscription_date_updated', function( $subscription, $date_type ) {
  2.     // Only proceed if it's a next_payment date change
  3.     if ( 'next_payment' !== $date_type || is_admin() ) {
  4.         return;
  5.     }
  6.  
  7.     // Make sure WP Fusion is active
  8.     if ( ! function_exists( 'wp_fusion' ) ) {
  9.         return;
  10.     }
  11.    
  12.     // Sync the subscription fields
  13.     wp_fusion()->integrations->{'woo-subscriptions'}->sync_subscription_fields( $subscription );
  14. }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement