Have you made changes to the HTML templates at all? The templates are no longer handled from the plugin admin, they must be customized with filters. See Template Customization from the GH wiki.
Any chance it’ll get submitted through wordpress.org so that we can get automated updates that don’t lose settings? I assume this is a pain in the butt to do.
It seems that the plugin was submitted to the Plugin Directory a few days ago:
Looks like it’s the official plugin, but i find it quite strange that nobody mentioned this here or on Github. Can anyone confirm that this is the real deal and we won’t lose our settings after each update with this?
Yes that’s the official wp-discourse plugin. We want to finish writing the plugin’s documentation and update its version number before giving it much publicity on here. If you already have the plugin installed, wait until the version number goes past 0.7.0 before updating it. For a new installation of the plugin, using the version in the plugin directory will be fine.
I’ve got a test version of Discourse installed (last week) and a test blog created (today) and I’m seeing quirks. Before these tests, I went through all of the Wordpress updates. Wordpress 4.5.3, and wp-discourse Version 0.9.1 (which I do not see a topic for).
Note settings for historical comments and changed minimum score:
Check your setting for ‘debug mode’. By default the plugin only syncs the Discourse comments once every 10 minutes. By enabling ‘debug mode’ it will sync the comments on every page request.
As mentioned on GitHub, the Emoji images sometimes have the wrong URL. The weird thing is that this only happens with some Emojis and comments, while others are fine.
I was able to edit discourse-comment.php to change the Leave a reply/Replies/Reply-Strings, but I would have to do that with every update. Is there any way to do this via the functions.php? I’ve tried the method from the wiki, but that didn’t work.
Is there any way to fix these problems? And thanks to everyone for the great new features added in 0.7.0 and above, which are awesome!
Yeah, I tried that. The main index page shows “2 comments”, but the actual post page (where the comments would appear) still shows “Start the discussion” AND the supposedly disabled Wordpress-native comment. And that’s this morning, well after a ten minute update window.
Yes this is because we’re trying to fix the Discourse urls with a regular expression
It falls apart if there is an absolute image path followed by a relative one. I think the emoji image paths have been fixed in the latest version of Discourse, so the best solution is to update the version of Discourse you are using.
Edit: If all you are trying to do is change the text content, there is an easier way to do it. I’ll add some documentation for overriding the plugin’s text content soon. But here is a quick example that could be added to your theme’s functions.php file.
add_filter( 'gettext', 'change_continue_discussion_text', 20, 3 );
function change_continue_discussion_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Continue the discussion' :
$translated_text = __( 'Join the discussion', 'wp-discourse' );
break;
}
return $translated_text;
}
Thanks for noticing that! It’s not included in any of the default templates, but it wasn’t doing anything at all. I’ve sent a PR that makes the {comment_url} equal the post_permalink + the comment number.
Yes, I’ve tried the add_filter( 'gettext', 'change_continue_discussion_text', 20, 3 ); method, but that erased several text blocks from the panel, while doing nothing on the site, so I just edited the plugin. I’m not even shure if I can translate that part, since it hooks into the comments_number and overwrites it? Or do I just need to use discourse_comments_count?
/**
* Returns the comments number.
*
* If Discourse comments are enabled, returns the 'discourse_comments_count', otherwise
* returns the $count value. Hooks into 'comments_number'.
*
* @param int $count The comment count supplied by WordPress.
*
* @return mixed|string
*/
function comments_number( $count ) {
global $post;
if ( $this->use_discourse_comments( $post->ID ) ) {
$this->sync_comments( $post->ID );
$count = get_post_meta( $post->ID, 'discourse_comments_count', true );
if ( ! $count ) {
$count = 'Leave a reply';
} else {
$count = ( 1 === intval( $count ) ) ? '1 Reply' : $count . ' Replies';
}
}
return $count;
}
Also, thank you so much for your help and the quick fixes regarding the Emojis and {comment_url}!
Edit:
I’ve just noticed another problem with comments.js and links to YouTube. It seems unable to get the correct ID and replaces it with “undefined”: