Title: Help Req: get_commentdata returning nothing?
Last modified: August 18, 2016

---

# Help Req: get_commentdata returning nothing?

 *  [fel64](https://wordpress.org/support/users/fel64/)
 * (@fel64)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/help-req-get_commentdata-returning-nothing/)
 * I’m trying to make a plugin that will register users when they make a comment
   if they are not already registered. Hooking myself into `comment_post` (which
   gives my function the comment ID) I then take the comment ID and using `get_commentdata`
   I want to get the comment data back, such as author name and email. (I then sanitize,
   check etc, then call `wp_create_user`).
 * However, `get_commentdata` is returning an empty array despite me passing along
   a valid comment ID. This is the output I get (I retrieved this output by `mail`
   ing it to myself):
 *     ```
       Array
       (
           [comment_ID] =>
           [comment_post_ID] =>
           [comment_author] =>
           [comment_author_email] =>
           [comment_author_url] =>
           [comment_author_IP] =>
           [comment_date] =>
           [comment_content] =>
           [comment_karma] =>
           [comment_approved] =>
           [comment_type] =>
       )
       ```
   
 * I do not _need_ to use `get_commentdata`, it just seemed like the appropriate
   function. How can I use it to get the comment data, or what function should I
   use instead and how?

The topic ‘Help Req: get_commentdata returning nothing?’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [fel64](https://wordpress.org/support/users/fel64/)
 * Last activity: [19 years, 3 months ago](https://wordpress.org/support/topic/help-req-get_commentdata-returning-nothing/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
