add_comment_meta() wordpress function and usage

Home / WordPress / WordPress Wiki / add_comment_meta() wordpress function and usage

add_comment_meta( int $comment_id, string $meta_key, mixed $meta_value, bool $unique = false )

Add meta data field to a comment.

Parameters

$comment_id

(int) (Required) Comment ID.

$meta_key

(string) (Required) Metadata name.

$meta_value

(mixed) (Required) Metadata value. Must be serializable if non-scalar.

$unique

(bool) (Optional) Whether the same key should not be added.

Default value: false

Return

(int|false) Meta ID on success, false on failure.

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments