Skip to content

Instantly share code, notes, and snippets.

@jrick1229
Last active September 30, 2022 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrick1229/9da77fcbaa677293a3e4ebd4299f89b9 to your computer and use it in GitHub Desktop.
Save jrick1229/9da77fcbaa677293a3e4ebd4299f89b9 to your computer and use it in GitHub Desktop.
WC Subscriptions – Create a log in WC > Status > Logs to log when a subscription has been updated.
<?php
add_action( 'wcs_webhook_subscription_updated', 'wcs_updated_log', 999, 1 );
function wcs_updated_log ( $subscription ){
$logger = wc_get_logger();
$logger->info( 'Subscription ID: ' . $subscription . ' was updated! -- ', array( 'source' => 'subscription-updates-2' ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment