2
0
Fork 0
mirror of https://github.com/discourse/wp-discourse.git synced 2025-10-03 08:59:21 +08:00

Use an id instead of a class for wpdc-comments div

This commit is contained in:
scossar 2017-12-10 13:05:53 -08:00
parent 801c944ac5
commit ebfbbbc958
2 changed files with 3 additions and 5 deletions

View file

@ -6,18 +6,16 @@
$( document ).ready(
function () {
var commentsURL = wpdc.commentsURL,
$commentArea = $( '.wpdc-comments' ),
$commentArea = $( '#wpdc-comments' ),
postId = $commentArea.data( 'post-id' );

$.ajax(
{
url: commentsURL + '?post_id=' + postId,
success: function (response) {
if (0 !== response) {
$commentArea.html( response );
}
}
}
);
}
)

View file

@ -2,4 +2,4 @@

global $post;

echo '<div class="wpdc-comments" data-post-id="' . $post->ID . '">discourse comments</div>';
echo '<div id="wpdc-comments" data-post-id="' . $post->ID . '"></div>';