• I have some custom comment notifications I’m writing for a client. The function takes the comment ID and builds the notification content. I’m trying to incorporate information in the custom field, but nothing comes through.

    I expected to be able to use:

    get_comment_meta($comment_id, "field_key", true);

    But no data comes back. Was I right to expect this to work? Is the field data stored differently?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author N-Media

    (@nmedia)

    Hi,

    please use following code

    get_comment_meta($comment_id, "wpcomment_fields", true);

    and it will return meta as array with key value.

    Thread Starter Cory

    (@corypina)

    Thanks, that got me what I needed.

    To clarify, the return value contains a key fields with an array of the meta values.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Accessing comment field data’ is closed to new replies.