Plugin Author
Nico
(@nicolamustone)
Automattic Happiness Engineer
Hi @tgiokdi,
Make sure that you’re using the latest version of WP Discord Post.
This issue has already been fixed.
I’ve verified that i’m using the current version of WP and this plugin, and I’m still seeing Discord messages for post updates.
Additionally, I’m seeing some notifications for autosaved drafts.
I see what the problem is, lines 294 – 302 indicate it’s looking for a postmeta of “_wp_discord_post_published” which is only going to be on posts that have been sent through the plugin’s notification system, which stores that postmeta.
Obviously this isn’t going to be the case for the thousands of other posts that were made previous to activation of the plugin.
Might I suggest that in your hooks on line 68, instead of hooking into ‘publish_post’, the hook goes on ‘wp_insert_post’?
Plugin Author
Nico
(@nicolamustone)
Automattic Happiness Engineer
Oh yeah, that is expected. If older posts don’t have the meta they will be processed by the plugin.
If you don’t want this to happen you can simply run an import for some meta (in case there are a lot of posts), or just write a quick script to add the meta to all the posts that don’t have it yet.
Use this second option if we are not talking about thousands of posts.
Plugin Author
Nico
(@nicolamustone)
Automattic Happiness Engineer
I added an option for this as well @tgiokdi.
After installing the latest version and “Version: 1.1.0”, the bot stopped posting the latest news on Discord for me.
The new feature “Send old posts to Discord…” was unchecked. I’m gonna see tomorrow if it works if I just check it. Although, my intention is not to post the older posts, so hoping this can be fixed on either my side or with an update.
Plugin Author
Nico
(@nicolamustone)
Automattic Happiness Engineer