Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger webhook with new redirection? #1

Open
bogdancss opened this issue Jul 8, 2021 · 1 comment
Open

Trigger webhook with new redirection? #1

bogdancss opened this issue Jul 8, 2021 · 1 comment

Comments

@bogdancss
Copy link

Thank you for you plugin - it's very handy when using Gatsby and Redirection!

I am looking into a way of triggering a new Gatsby build when there is a new/changed/removed redirection. I have not seen any option in the Redirection plugin itself, but was wondering if it's possible to trigger the webhook somewhere else - maybe in the functions file?

@evrenbal
Copy link

evrenbal commented May 7, 2022

It's been a long time after you open the issue and probably you already figured out the solution but I would like to leave a hint for others requiring the same feature.

It is possible to trigger your custom webhook by injecting a function into "redirection_redirect_updated" action (by using WP's add_action). Within this function you may use WP's wp_remote_post() or wp_remote_get() functions to send a request to remote webhook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants