Check the Comment in Reply or Normal State

I’m currently working with custom comment meta, and I have some custom additional field such as rating etc, when user write a comment ( not comment reply ) I want to show the rating field, but when it’s on reply comment state I want to remove this field.

Is there a build in conditional function to check whether it’s in a reply state or not? or any other way to achieve what I want?

2 Answers
2

Check for the comment_parent:

if( '0' != $comment->comment_parent ){
    // this is a reply
}

Leave a Comment