Contributors: Preciousomonze (Code Explorer) 🤓
Donate link: Drop something for your boy 😋 🤓 🥳 🤑
Requires at least: 4.9
Tested up to: 5.2
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
This class helps you create your custom webhook url you can use for whatever reason. you can include it in your plugin and call the file, or make it an mu-plugin(Must-Use plugin) (Read about mu-plugins here).
- Download the class-wp-webhook.php file.
- Customize the following to your unique values:
- Class name :
Pekky_WP_Webhook
to your custom name you want - change the values of
private static $webhook
,private static $webhook_tag
, andprivate static $webhook_action
to what you want.
/**
* Parent wekbhook
* replace with a unique value you want
*
* @var string
*/
private static $webhook = 'pekky-api';
/**
* webhook tag
* replace with a unique value you want
*
* @var string
*/
private static $webhook_tag = 'pekky_webhook';
/**
* Action to be triggered when the url is loaded
* replace with a unique value you want
*
* @var string
*/
private static $webhook_action = 'hook_action';
- 🤧 that's all.
- download the mu-class-wp-webhook.php file in the repo.
- put the file in your wordpress site directory inside wp-content/mu-plugins folder(this the default mu-plugin folder, if you've altered it, please use your respective folder).
- 🤧 that's all.