manifest / integrations / wordpress-webhook-plugin
Wordpress Webhook
This is a plugin test for Wordpress webhooks
by Julian MyRehat · github.com/silvalian0410/wordpress-webhook-plugin
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/silvalian0410/wordpress-webhook-plugin/archive/refs/heads/main.zipwordpress-webhook-plugin.php
This is a plugin test for Wordpress webhooks
Note
This works to any framework / CMS that uses PHP
How it Works
Action Hook
add_action('save_post', 'save_post_webhook', 10, 3); // save_post is a function created by Wordpress
- Hooks into the save_post action, which is triggered whenever a post is saved. You can also use this in any function
- Constructs a message indicating the post ID.
- Defines the URL to which the webhook will be sent.
- Sets up the arguments for the POST request, including the message in the body.
- Sends the POST request to the specified URL using wp_remote_post.
Description
The Test Plugin adds webhook functionalities to any Wordpress theme. It triggers a webhook whenever a post is saved, sending a message to a specified URL.
Installation
- Download the plugin files.
- Upload the plugin files to the
/wp-content/plugins/wordpress-webhook-plugin/directory, or install the plugin through the WordPress plugins screen directly. - Update the wordpress-webhook-plugin.php and add any webhook triggers I'm using Zapier :
$url = 'Webhook Links'; - Activate the plugin through the 'Plugins' screen in WordPress.
- Filter Your Data
- Try it and see if there is data sent
Usage
Once activated, the plugin will automatically send a webhook to the specified URL whenever a post is saved.