Last active
January 1, 2016 21:58
-
-
Save asharirfan/aad0df02601958a32305 to your computer and use it in GitHub Desktop.
A function for WordPress. It returns true if comment is a parent and false it comment is a child.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Comment Parent Check | |
* | |
* Returns true if comment is a parent comment | |
* and false if it is child comment | |
* | |
*/ | |
function aa_comment_parent($aa_comment_id) { | |
$aa_comment = get_comment($aa_comment_id); | |
$aa_comment_parent_id = $aa_comment->comment_parent; | |
if ( $aa_comment_parent_id == 0 ) : return true; else : return false; endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment