Comment::setMeta() method

Set meta data (custom fields for comments)

To set multiple properties at once specify an associative array for $key and omit $value.

Available since version 3.0.203.

Usage

// basic usage
$self = $comment->setMeta($key);

// usage with all arguments
$self = $comment->setMeta($key, $value = null);

Arguments

NameType(s)Description
keystring, array

Property name to set or assoc array of them

value (optional)null, string, array, int, float, mixed

Value to set for $key or omit of you used an array.

Return value

self


Comment methods and properties

API reference based on ProcessWire core version 3.0.209

Twitter updates

  • Adding custom actions to ProcessWire image fields in the admin, part of this week’s dev branch additions: More
    27 January 2023
  • ProcessWire 3.0.210 new main/master version released— More
    6 January 2023
  • ProcessWire 3.0.209: Core updates and an interesting AI that knows ProcessWire– More
    30 December 2022

Latest news

  • ProcessWire Weekly #456
    The 456th issue of ProcessWire Weekly covers latest core updates, introduces a new third party module called TextformatterRockDown, and more. Read on!
    Weekly.pw / 4 February 2023
  • ProcessWire 3.0.210 new main/master version
    140 commits, 55 resolved issues, dozens of new features, eight contributors, and five new pull requests make yet another great new version of ProcessWire.
    Blog / 6 January 2023
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits