Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 2.21 KB

README.md

File metadata and controls

64 lines (49 loc) · 2.21 KB

WordPress Custom Webhook Class

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

Description

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 😆😂

How to use

Including it into your custom plugin

  1. Download the class-wp-webhook.php file.
  2. 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, and private 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';
This step 2 also applies to Including it as an mu-plugin
  1. 🤧 that's all.

Including it into your custom plugin

  1. download the mu-class-wp-webhook.php file in the repo.
  2. 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).
  3. 🤧 that's all.

Frequently Asked Questions

None 😁😗

If you have, feel free to create an issue.

Note: You better not remove my signature from the code when using it 🤺😑