Last active
May 9, 2016 05:04
-
-
Save BFTrick/8696222 to your computer and use it in GitHub Desktop.
Hooking into the cancelled subscription hook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Cancelled Subscriptions Hook | |
| Plugin URI: https://gist.github.com/BFTrick/8696222 | |
| Description: Hook into the WooCommerce Cancelled Subscriptions hook and print the data. | |
| Version: 1.0.0 | |
| Author: Patrick Rauland | |
| Author URI: http://www.patrickrauland.com | |
| */ | |
| function my_cancelled_subscription( $user_id, $subscription_key ) { | |
| echo "user_id is: "; | |
| print_r( $user_id ); | |
| echo "\r\n"; | |
| echo "subscription_key is: "; | |
| print_r( $subscription_key ); | |
| exit(); | |
| } | |
| add_action( 'cancelled_subscription', 'my_cancelled_subscription', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user_id is: X subscription_key is: XXXXX_XXXXX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use standard paypal, when customer cancel subscription from paypal account, this code is not working. :(.
Other hook work well: add_action('processed_subscription_payment', 'subPay', 10, 2);