Falcon_Connector_WordPress::get_references_for_comment PHP Метод

get_references_for_comment() защищенный Метод

Get the References for a comment
protected get_references_for_comment ( stdClass $comment ) : string
$comment stdClass Comment object
Результат string Message ID
    protected function get_references_for_comment($comment)
    {
        $references = array();
        if (!empty($comment->comment_parent)) {
            // Add parent's references
            $parent = get_comment($comment->comment_parent);
            $references = array_merge($references, $this->get_references_for_comment($parent));
            // Add reference to the parent itself
            $references[] = $this->get_message_id_for_comment($parent);
        } else {
            // Parent is a post
            $parent = get_post($comment->comment_post_ID);
            $references[] = $this->get_message_id_for_post($parent);
        }
        return $references;
    }