Home › Forums › Stripe Payments Plugin › I need to hook into the cancel subscription function › Reply To: I need to hook into the cancel subscription function
This particular hook is triggered by a Stripe hook. It runs early on the loading process so this code needs to be put into a place that is visible much earlier. If you are putting the code into a file that is loading AFTER the hook is being triggered, then you will see the behavior that you are seeing. Not all hooks are triggered at the same time. Different hooks have different conditions. You may need to get help from a WordPress coder for this.
You should probably make a small custom plugin and put this custom code in that plugin so it is visible when that hook is triggered. It’s generally a good idea to put all your customization code into a separate plugin. Otherwise in the future if you switch your theme, you will lose all the customization.