Make WordPress Core

Opened 14 years ago

Closed 12 years ago

#16965 closed enhancement (worksforme)

Additional documentation for get_comment_meta

Reported by: nprasath002's profile nprasath002 Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.1
Component: Inline Docs Keywords: has-patch
Focuses: Cc:

Description

the documentation for get_comment_meta in comment.php can be improved.
The metakey and the single value are optional.

Attachments (1)

comment_meta_doc.diff (834 bytes) - added by nprasath002 14 years ago.

Download all attachments as: .zip

Change History (5)

#1 @nprasath002
14 years ago

  • Cc n.prasath.002@… added

#2 @scribu
14 years ago

  • Component changed from Comments to Inline Docs

#3 @dd32
14 years ago

The $meta_key is not optional at present with the function as-is. You can however pass a blank string to it to retrieve all meta.

Setting a default on $key would however allow that.

function get_comment_meta($comment_id, $key, $single = false) {
   return get_metadata('comment', $comment_id, $key, $single);
}

#4 @nacin
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.