I'm sure this must be a silly error by me but I haven't been able to solve it...
I added an extra 'rating' field to my comments form so that users can rate posts. Everything works fine and by using
add_comment_meta( $comment_id, 'rating', $rating ) it gets inserted fine in the
However, when I try to retrieve the value using
get_comment_meta( comment_ID(), 'rating', true ) I'm getting the comment ID instead of the rating value.
Any ideas on what could be wrong? Thanks in advance...
comment_ID() echoes the ID. What I needed was
get_comment_meta( get_comment_ID(), 'rating', true )