-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels