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).
Reason: This was developed based on the vexation of Haastrup Adejoke trying to develop webhooks ππ
- Download the class-wp-webhook.php file.
- Customize the following to your unique values:
- Class name :
Pekky_WP_Webhookto your custom name you want - change the values of
private static $webhook,private static $webhook_tag, andprivate static $webhook_actionto 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.