Skip to content

Instantly share code, notes, and snippets.

@JMWebDevelopment
Created December 19, 2016 02:52
Show Gist options
  • Save JMWebDevelopment/aa749ec7188b7f4d6b97ec4895d96ebd to your computer and use it in GitHub Desktop.
Save JMWebDevelopment/aa749ec7188b7f4d6b97ec4895d96ebd to your computer and use it in GitHub Desktop.
this.getCommentDepth = function ( theComment, comments_list ) {
var depthLevel = 0;
while ( theComment.comment_parent > 0 ) {
theComment = this.getCommentById( theComment.comment_parent, comments_list );
depthLevel++;
}
return depthLevel;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment