FieldtypeComments::voteComment()

Add a vote to the current comment from the current user/IP

Usage

// basic usage
$bool = $fieldtypeComments->voteComment(Page $page, Field $field, Comment $comment);

// usage with all arguments
$bool = $fieldtypeComments->voteComment(Page $page, Field $field, Comment $comment, bool $up = true);

Arguments

NameType(s)Description
$pagePage
$fieldField
$commentComment
$up (optional)bool

Specify true for upvote, or false for downvote

Return value

bool

Returns true on success, false on failure or duplicate


FieldtypeComments methods and properties

API reference based on ProcessWire core version 3.0.251