A webhook to send a notification when a category is created/modified/deleted?

(Coin-coin le Canapin) #1

Is such a thing possible?

(Simon Cossar) #2

I’m sure it’s possible, but I don’t know if it’s a priority. Right now the wp-discourse plugin refreshes categories by having an administrator of the site click on a Force Category Update checkbox on the Publishing settings tab. This is efficient, but could lead to confusion if categories are added to Discourse but not refreshed on WordPress. If a webhook was available, it would just setup a route for the webhook, and refresh the categories when they change.

If the plugin you are working on works in conjunction with the wp-discourse plugin, you can access the Discourse categories with WPDiscourse\Utilities\Utilities::get_discourse_categories().

(Coin-coin le Canapin) #3

Thank you for your reply. My plugin doesn’t work in conjunction with WP-Discourse.

edit: it seems not too complicated to code a custom webhook, I shall look at this way.