• Hello,

    On the changelog for version 2.0.0 I do not understand how to making the following feature work.
    New: options to specify separate webhooks for each post type (you can use this to send posts, orders, etc. in different channels, also private ones).

    Basically I have 2 Discord Channels. Announcements Channel and a Updates Channel. I would like specific posts to post to the Announcements Channel and others to Post to the Updates Channel. Based on the Changelog it sounds like this is possible but I do not understand how to do it.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nicola Mustone

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello,
    This is not possible. You can send different post types to different channels, but not the same ones in different channels.

    So you can, for example, send posts to Announcements, and products to Updates, but not some posts to one and other posts to the other.

    There would be a way by using hooks. You can use the hook wp_discord_post_before_request to intercept any request that is about to be sent to Discord, check the post type and its category (or whatever you want to use to determine in which channel they need to go) and then perform a request to send it to another channel via webhooks. Make sure to exit; at the end of your function to avoid sending the request twice.

    Thread Starter mortalites

    (@mortalites)

    I apologize but can you show me how to setup different post types to different channels? I really do not know what I am doing and this hook feature sounds promising but again I have no idea how to do this either.

    It looks like picking 2 different post types will not work for me. I think Post type Post is the only is the only type that will work unless I can fake one of the other Post types into looking like a regular Post? Or what about basing the channel that is posts to from the WordPress Category? Sorry to be such a pain.

    Post (Post Type: ‘post’)
    Page (Post Type: ‘page’)
    Attachment (Post Type: ‘attachment’)
    Revision (Post Type: ‘revision’)
    Navigation Menu (Post Type: ‘nav_menu_item’)
    Custom CSS (Post Type: ‘custom_css’)
    Changesets (Post Type: ‘customize_changeset’)

    Thanks,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help with Seperate Webhooks Feature’ is closed to new replies.