• Resolved arifba

    (@arifba)


    Hi – hoping to use your plugin to send a webhook to a server of our choosing, when a post is created.

    It works well if we create a normal post however, most of our posts are custom post types and nothing seems to be fired.

    I see some support requests talking about custom post types so – is this supported?

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ironikus

    (@ironikus)

    Hey @arifba – thank you a lot for your message.
    Yes, our plugin also supports custom post types.
    Can you please share further details on the webhook settings for the webhook URL you added as a trigger? In case you have chosen there only the Post Post Type. It will only be sent on that one.
    Thank you already a lot.

    Thread Starter arifba

    (@arifba)

    Thanks for getting back to me. Actually I see nothing posted to the url, even for normal posts (let’s forget the custom post type, don’t think that’s the issue).

    What I thought was getting posted for normal posts was actually a post in auto-draft status (that does hit the webhook url during post creation). Is nothing sent on post publish because of this auto-draft sending a webhook during drafting of the post?

    Settings are:
    webhook name: post-create
    webhook url: https://291eb378660b.ngrok.io/webhooks/wp-post-create

    ‘Send Demo’ successfully sends a payload to the server and I see an http status 100 Continue.

    In settings tab I have ‘Send Data on New Post’ toggled on under ‘Activate Send Data Triggers’. Nothing toggled on under ‘Activate Receive Data Actions’.

    Nothing hits the webhook url on a new post creation/publish.

    Arif

    Plugin Contributor Ironikus

    (@ironikus)

    Hey @arifba – thank you for the additional details.
    That makes your case more clear to me. In your reply you talk about triggers (Send Data) webhooks, correct?
    If so, the issue probably is because WordPress restricts the domain since it looks unsafe.
    We had some cases like that before, which have used a similar solution to the following: https://github.com/Ironikus/wp-webhooks/issues/1

    Anyways, I talked back with my team and we will add a feature within the webhook settings that allow you to do exactly that without touching the code. ??
    We will launch this version next week, so you can either wait or create your own fix with the link above. ??

    Thread Starter arifba

    (@arifba)

    Thanks but that’s not it – the url is fine and is publicly accessible – if it wasn’t there wouldn’t be a post from your plugin to the endpoint on auto-draft creation.

    Maybe it’s something with our wordpress setup, not sure.

    I worked around it by just implementing a home-grown webhook post to our endpoint via the wordpress function transition_post_status.

    Thank you for your quick support.

    Plugin Contributor Ironikus

    (@ironikus)

    Hey @arifba – thank you again for your feedback. So if something is sent in the first place, then you are right that this can’t be the issue.
    Is it possible that you might have chosen to trigger the webhook only on specific post types?
    You can check on that within the “Send Data” -> “Send Data on New Post” -> Your webhook URL -> Settings -> “Trigger on selected post types”

    If that’s the case, simply just uncheck the post type there so that it will be triggered at all. ??

    Plugin Contributor Ironikus

    (@ironikus)

    Hey @arifba – I hope you are doing well. Since I haven’t heard back from you for a while, I assume you could solve the task.
    If you have any additional questions, feel free to reach out at any time, we’re happy to assist! ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘webhook not fired when a new post is created that belongs to a custom post type’ is closed to new replies.