You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When accessing the above-mentioned endpoint with wp-ulike plugin installed, the following notice is generated:
Notice: Trying to get property 'comment_ID' of non-object in /var/www/html/wp-includes/comment-template.php on line 673
This renders the JSON invalid. On debugging I found that wp_ulike_comments() function calls get_comment_ID which depends on the global $GLOBALS['comment'] to get the current comment. This variable is set by an instance of Walker_Comment class (or its subclass), which is instantiated in the get_comment_pages_count function of the file wp-includes/comment.php. Probably this function is not called when accessing the comments endpoint through rest API, and hence the notice.
I know I can set the WP_DEBUG flag to false and get rid of the notice, but this seems like broken.
The text was updated successfully, but these errors were encountered:
When accessing the above-mentioned endpoint with wp-ulike plugin installed, the following notice is generated:
This renders the JSON invalid. On debugging I found that
wp_ulike_comments()
function callsget_comment_ID
which depends on the global$GLOBALS['comment']
to get the current comment. This variable is set by an instance ofWalker_Comment
class (or its subclass), which is instantiated in theget_comment_pages_count
function of the filewp-includes/comment.php
. Probably this function is not called when accessing the comments endpoint through rest API, and hence the notice.I know I can set the
WP_DEBUG
flag tofalse
and get rid of the notice, but this seems like broken.The text was updated successfully, but these errors were encountered: