Executing a function upon webhook calling wordpress
I assume it is best to have webhooks that run from like say thrivecart, or other processors, execute code from a plugin, so that updates do not overwrite custom coding…
I’ve never created a plugin before, and just learned how to create a very basic plugin.
So I’ve done that. My question is, how do I have a webhook execute it on callback?
Say something like S2member does it:
google.com/?s2membersomethingorother=1 (removed the https to keep it from creating a link)
is that the way, then have WP listen for that value, and if it exists, execute that code in the plugin?
But how do I get WP to listen and not quit listening after updates?
Is there a best practice for it?
I need a simple few lines of code to check if the user is valid then upgrade their membership role.
I have the code for S2Member to check it all, but no idea how to get WP to execute it.
Can someone point me to a resource where I can learn that?
I’ve scoured the API and scripting stuff, but cannot seem to find what I’m looking for.
I’d appreciate any assistance you can offer.
My best,
-Richard
Leave an answer