Skip to content

Commit 45c5f72

Browse files
committed
Merge pull request #4 from aprea/object-fix
Plugin throwing "Creating default object from empty value" in the JS, fixed in this commit
2 parents 9ed0ea0 + 91abfc4 commit 45c5f72

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

live-comment-preview.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ function lcp_output_js() {
5454

5555
$post->comment_status = 'open';
5656

57+
if( ! is_object( $comment ) ) {
58+
$comment = new stdClass();
59+
}
60+
5761
$comment->comment_ID = 'lcp';
5862
$comment->comment_content = 'COMMENT_CONTENT';
5963
$comment->comment_author = 'COMMENT_AUTHOR';

0 commit comments

Comments
 (0)