I’ve put a few pull requests into the hopper on github for the wp-discourse plugin that fix a bug and add a couple minor features to the plugin to fit how I want to use it as I have been integrating Discourse into an existing WordPress site that I manage. I thought I would post a little summary about them here.
-
In the HTML template for each comment there is a comment-meta item that is the datetime for when the comment was posted. That data is supposed to be wrapped with an HTML
<time>
tag. But that tag is not on WordPress’s global list of allowed tags and so it was getting filtered out of the HTML that was being output on the front end. I just added the<time>
tag to the list of allowed tags for the sake of the wp-discourse plugin to fix this. See: https://github.com/discourse/wp-discourse/pull/135 -
The way the plugin was formatting the datetime from the Discourse comment, it was only using the format string for a date from the WP site’s preferences. So the datetime was only a date (no time). I added a new custom datetime format string to the admin that allows you to format the datetime string however you want, consistent with WordPress datetime formatting options. See: https://github.com/discourse/wp-discourse/pull/136
-
The last one is my answer to what to do about enabling Discourse comments for existing WP posts/pages that have a lot of valuable pre-existing WP comments on them. It would be nice to be able to cleanly export WP comments into Discourse, but there is no currently existing importer for standard WP comments and there are a lot of edge cases that make developing one too big a chore for me. The current behavior of the wp-discourse plugin makes you choose to either show Discourse comments and hide the old WP comments OR show the WP comments and not show the Discourse comments. This patch lets you enable Discourse comments for existing posts and choose to show the existing WP comments as a “historical archive” beneath the new Discourse comments. See: https://github.com/discourse/wp-discourse/pull/137