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.
Common
Name | Return | Summary | |
---|---|---|---|
Comment::allowChildren() Comment::allowChildren() Comment::allowChildren() | bool | Are child comments (replies) allowed? | |
Comment::approvalNote | null string | Runtime approval note for newly added comment, internal use (since 3.0.169) | |
Comment::children() Comment::children() Comment::children() | CommentArray | Return children comments, if applicable Can also be used as property: Comment::children | |
Comment::cite | string | ||
Comment::cleanCommentString() Comment::cleanCommentString(string $str) Comment::cleanCommentString(string $str) | string | Clean 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() Comment::depth() Comment::depth() | int | Get current comment depth Can also be used as property: Comment::depth | |
Comment::downvotes | int | ||
Comment::editUrl() Comment::editUrl() Comment::editUrl() | string | Return URL to edit comment | |
Comment::email | string | ||
Comment::flags | int | ||
Comment::get() Comment::get(string $key) Comment::get(string $key) | mixed | Get property | |
Comment::getField() Comment::getField() Comment::getField() | null Field CommentField | Get Field that this Comment belongs to | |
Comment::getFormatted() Comment::getFormatted(string $key) Comment::getFormatted(string $key, array $options = []) | string | Same as get() but with output formatting applied | |
Comment::getFormattedCommentText() Comment::getFormattedCommentText() Comment::getFormattedCommentText(array $options = []) | string | Get comment text as formatted string | |
Comment::getGravatar() Comment::getGravatar(string $email) Comment::getGravatar(string $email, string $rating = 'g', string $imageset = 'mm', int $size = 80) | string | Returns a URL to this user's gravatar image (static version, use non-static gravatar() function unless you specifically need static) | |
Comment::getMeta() Comment::getMeta() Comment::getMeta($key = null) | string array int float mixed null | Get meta data property value (custom fields for comments) | |
Comment::getPage() Comment::getPage() Comment::getPage() | null Page | Get Page that this Comment belongs to | |
Comment::gravatar() Comment::gravatar() Comment::gravatar(string $rating = 'g', string $imageset = 'mm', int $size = 80) | string | Returns a URL to this user's gravatar image | |
Comment::hasChild() Comment::hasChild($comment) Comment::hasChild($comment, bool $recursive = true) | bool | Does this comment have the given child comment? | |
Comment::httpUrl() Comment::httpUrl() Comment::httpUrl() | string | Return full http URL to view comment | |
Comment::id | int | ||
Comment::ip | string | ||
Comment::isApproved() Comment::isApproved() 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() Comment::meta() Comment::meta($key = null, $value = null) | array string int mixed | Get or set meta data property | |
Comment::numChildren() Comment::numChildren() Comment::numChildren(array $options = []) | int | Return number of children (replies) for this comment Can also be used as property: Comment::numChildren | |
Comment::parent() Comment::parent() Comment::parent() | Comment null | Return the parent comment, if applicable Can also be used as property: Comment::parent | |
Comment::parent_id | int | ||
Comment::parents() Comment::parents() Comment::parents() | CommentArray | Get CommentArray of all parent comments for this one Can also be used as property: Comment::parents | |
Comment::prevStatus | int null | ||
Comment::quiet() Comment::quiet() Comment::quiet(bool $quiet = null) | bool | Get or set quiet mode | |
Comment::removeMeta() Comment::removeMeta(string $key) Comment::removeMeta(string $key) | self | Remove given meta data property or '*' to remove all | |
Comment::renderStars() Comment::renderStars() Comment::renderStars(array $options = []) | string | Render stars markup | |
Comment::set() Comment::set(string $key, mixed $value) Comment::set(string $key, mixed $value) | self WireData | Set property | |
Comment::setField() Comment::setField(Field $field) Comment::setField(Field $field) | (nothing) | Set Field that this Comment belongs to | |
Comment::setMeta() Comment::setMeta($key) Comment::setMeta($key, $value = null) | self | Set meta data (custom fields for comments) | |
Comment::setPage() Comment::setPage(Page $page) 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() Comment::url() Comment::url(bool $http = false) | string | Return URL to view comment | |
Comment::user_agent | string | ||
Comment::website | string | ||
Comment::wired() Comment::wired() 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