I have the normal “post” post type that gets auto-published as expected using the WP Discourse plugin. I also have another post type, that is Gutenberg-editor-enabled, but the only way I can assign existing or freshly/manually-created-topics (by the community) to it if I mark it here:
But also auto-publishes everything I do with posts of this type as well. How do I separate these concerns? I’m a dev and if pointed to the right direction I could apply some code. I prefer to manually link entries from this post type with their topics in the forum, if any.
I can be wrong; I don’t think you can do with the settings alone.
What about using Exclude Posts By Tag? You could apply automatically (with a plugin) a specific tag to these custom post types. Would it that work for you?
You also can filter with code with wpdc_publish_after_save.
Yeah the filter was the key! I have this as part of a class and seems to work fine:
add_filter('wpdc_publish_after_save', [$this, 'prevent_autopublish_for_konyv'], 10, 3);
public function prevent_autopublish_for_konyv($publish_to_discourse, $post_id, $post)
{
if ('konyv' === get_post_type($post)) {
return false; // Prevent auto-publishing for 'konyv' post type
}
return $publish_to_discourse; // Allow normal behavior for other post types
}