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

Only load comments if we have a post id (#553)
Some checks failed
WP-Discourse Formatting / Formatting on PHP 5.6 (push) Has been cancelled
WP-Discourse Formatting / Formatting on PHP 7.0 (push) Has been cancelled
WP-Discourse Formatting / Formatting on PHP 7.4 (push) Has been cancelled
WP-Discourse Formatting / Formatting on PHP 8.0 (push) Has been cancelled
WP-Discourse Tests / Tests on PHP 8.2 (push) Has been cancelled

This commit is contained in:
Angus McLeod 2025-09-30 21:01:32 +01:00 committed by GitHub
parent 4181491e51
commit 4b95944d27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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

if (!postId) {
return;
}

$.ajax(
{
url: commentsURL + '?post_id=' + postId,