Created
July 13, 2021 16:27
-
-
Save andrewlimaza/b1bd929e72eee619eb28c368fb5311a3 to your computer and use it in GitHub Desktop.
Custom WP Zapier webhook example
This file contains 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 | |
/** | |
* Looks for a custom variable passed to WP Zapier. Adjust custom-var in your Zapier data (key/data pair) | |
* Add this code to your site by following this guide - https://yoohooplugins.com/customize-wordpress/ | |
*/ | |
function my_own_webhook_2() { | |
$custom_identifier = $_REQUEST['custom-var']; | |
// If this custom identifier isn't present, bail. | |
if ( ! $custom_identifier ) { | |
return; | |
} | |
// Do custom code here for this custom event. | |
} | |
add_action( 'wp_zapier_custom_webhook', 'my_own_webhook_2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment