Would it be possible to add more than one webhook? It doesn’t need to be filtered by categories, I just want to notify more than one server every time.
]]>I’m using your plugin, and it’s great! Only issue I find is that it is not transferring featured image from post to Discord message.
It’s not going across in text or embed mode (or with or without the one line I added to post to forums, see suggestion in other entry :0) ).
[29-Oct-2023 17:22:23 UTC] Array
(
[id] => 192
[status] => publish
[date] => 2023-10-29 17
[current_time] => 2023-10-29 17
)
[29-Oct-2023 17:22:23 UTC] Webhook for Discord - Post 192 maybe is new. _discord_webhook_published =
[29-Oct-2023 17:22:23 UTC] Array
(
[0] => Array
(
[title] => Test 2 with Featured
[type] => rich
[description] => sdf asdf asdfasdf
[url] => https://mithmort.com/test-2-with-featured/
[timestamp] => 2023-10-29T17:22:23+00:00
[footer] => Array
(
[text] => Mithmort's Morgue
[icon_url] => https://mithmort.com/wp-content/uploads/2023/10/Mithmort-Base-Logo-Transparent-Background-500.png
)
[image] => Array
(
[url] =>
)
[author] => Array
(
[name] => Mithmort
)
[fields] => Array
(
)
)
)
[29-Oct-2023 17:22:23 UTC] Array
(
[headers] => Array
(
[Authorization] => Bot
[Content-Type] => application/json
)
[body] => {"content":"Mithmort just published the post Test 2 with Featured on their blog: https:\/\/mithmort.com\/test-2-with-featured\/","username":"WPBOT","avatar_url":"https:\/\/mithmort.com\/wp-content\/uploads\/2023\/10\/WPBOT_Avatar.png","thread_name":"Test 2 with Featured","embeds":[{"title":"Test 2 with Featured","type":"rich","description":"sdf asdf asdfasdf","url":"https:\/\/mithmort.com\/test-2-with-featured\/","timestamp":"2023-10-29T17:22:23+00:00","footer":{"text":"Mithmort's Morgue","icon_url":"https:\/\/mithmort.com\/wp-content\/uploads\/2023\/10\/Mithmort-Base-Logo-Transparent-Background-500.png"},"image":{"url":""},"author":{"name":"Mithmort"},"fields":[]}]}
)
[29-Oct-2023 17:22:24 UTC] Webhook for Discord - Request sent.
[29-Oct-2023 17:22:25 UTC] Array
(
[id] => 192
[status] => publish
[date] => 2023-10-29 17
[current_time] => 2023-10-29 17
)
[29-Oct-2023 17:22:25 UTC] Webhook for Discord - Post 192 maybe is new. _discord_webhook_published = 1
[29-Oct-2023 19:51:57 UTC] Array
(
[id] => 197
[status] => publish
[date] => 2023-10-29 19
[current_time] => 2023-10-29 19
)
[29-Oct-2023 19:51:57 UTC] Webhook for Discord - Post 197 maybe is new. _discord_webhook_published =
[29-Oct-2023 19:51:57 UTC] Array
(
[headers] => Array
(
[Authorization] => Bot
[Content-Type] => application/json
)
[body] => {"content":"Mithmort just published the post Test 2 w\/o Embed and w\/ Featured on their blog: https:\/\/mithmort.com\/test-2-w-o-embed-and-w-featured\/","username":"WPBOT","avatar_url":"https:\/\/mithmort.com\/wp-content\/uploads\/2023\/10\/WPBOT_Avatar.png"}
)
[29-Oct-2023 19:51:57 UTC] Webhook for Discord - Request sent.
[29-Oct-2023 19:51:58 UTC] Array
(
[id] => 197
[status] => publish
[date] => 2023-10-29 19
[current_time] => 2023-10-29 19
)
[29-Oct-2023 19:51:58 UTC] Webhook for Discord - Post 197 maybe is new. _discord_webhook_published = 1
]]>
I’m using your plugin, tis great!
Suggestion: If you add ‘thread_name’ => $embed[‘title’], to the function _send_request in the class-discord-webhook-http.php file, ~ line 217, then users will be able to use this plugin to post to Discord forums.
I added that line and it’s working well.
NOTE: I’m only using the embed mode, so this works for me. Obviously, if you want to add it and have it work for other peeps who might be using the non-embed mode, this would need to change accordingly to accommodate both. :0)
private function _send_request( $content, $embed ) {
$args = array(
'content' => html_entity_decode( esc_html( $content ) ),
'username' => esc_html( $this->get_username() ),
'avatar_url' => esc_url( $this->get_avatar() ),
'thread_name' => $embed['title'],
);
]]>
Was working fine last week, but the post I added this week did not share to Discord. Running WP 6.2. Maybe there was an WP update in between and it finally broke it
]]>