Located in file /wire/modules/Fieldtype/FieldtypeComments/Comment.php

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Comment class also inherits all the methods and properties of: WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
Comment::allowChildren()
boolAre child comments (replies) allowed? 
Comment::approvalNote null string Runtime approval note for newly added comment, internal use (since 3.0.169) 
Comment::children()
CommentArrayReturn children comments, if applicable
Can also be used as property: Comment::children
 
Comment::cite string  
Comment::cleanCommentString(string $str)
stringClean a comment string by issuing several filters 
Comment::code string  
Comment::created int  
Comment::createdUser User User that created the comment 
Comment::created_users_id int  
Comment::depth()
intGet current comment depth
Can also be used as property: Comment::depth
 
Comment::downvotes int  
Comment::editUrl()
stringReturn URL to edit comment 
Comment::email string  
Comment::flags int  
Comment::get(string $key)
mixedGet property 
Comment::getField()
null Field CommentFieldGet Field that this Comment belongs to 
Comment::getFormatted(string $key)
stringSame as get() but with output formatting applied 
Comment::getFormattedCommentText()
stringGet comment text as formatted string 
Comment::getGravatar(string $email)
stringReturns a URL to this user's gravatar image (static version, use non-static gravatar() function unless you specifically need static) 
Comment::getMeta()
string array int float mixed nullGet meta data property value (custom fields for comments) 
Comment::getPage()
null PageGet Page that this Comment belongs to 
Comment::gravatar()
stringReturns a URL to this user's gravatar image 
Comment::hasChild($comment)
boolDoes this comment have the given child comment? 
Comment::httpUrl()
stringReturn full http URL to view comment 
Comment::id int 
Comment::ip string  
Comment::isApproved()
(nothing)Returns true if the comment is approved and thus appearing on the site 
Comment::isNew null bool Was this comment added in this request? (since 3.0.169) 
Comment::loaded bool True when comment is fully loaded from DB (since 3.0.149) 
Comment::meta()
array string int mixedGet or set meta data property 
Comment::numChildren()
intReturn number of children (replies) for this comment
Can also be used as property: Comment::numChildren
 
Comment::parent()
Comment nullReturn the parent comment, if applicable
Can also be used as property: Comment::parent
 
Comment::parent_id int  
Comment::parents()
CommentArrayGet CommentArray of all parent comments for this one
Can also be used as property: Comment::parents
 
Comment::prevStatus int null 
Comment::quiet()
boolGet or set quiet mode 
Comment::removeMeta(string $key)
selfRemove given meta data property or '*' to remove all 
Comment::renderStars()
stringRender stars markup 
Comment::set(string $key, mixed $value)
self WireDataSet property 
Comment::setField(Field $field)
(nothing)Set Field that this Comment belongs to 
Comment::setMeta($key)
selfSet meta data (custom fields for comments) 
Comment::setPage(Page $page)
(nothing)Set Page that this Comment belongs to 
Comment::sort int  
Comment::stars int 
Comment::status int 
Comment::subcode string  
Comment::text string  
Comment::textFormatted string null Text value formatted for output (runtime use only, must be set manually) 
Comment::upvotes int  
Comment::url()
stringReturn URL to view comment 
Comment::user_agent string  
Comment::website string  
Comment::wired()
(nothing)Wired to API 

Additional methods and properties

In addition to the methods and properties above, Comment also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #515
    In the 515th issue of ProcessWire Weekly we’ll check out the latest core updates, new modules, and more. Read on!
    Weekly.pw / 23 March 2024
  • Invoices Site Profile
    The new invoices site profile is a free invoicing application developed in ProcessWire. It enables you to create invoices, record payments to them, email invoices to clients, print invoices, and more. This post covers all the details.
    Blog / 15 March 2024
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer