Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working on a rather odd implementation that stretches the limits of WP a little - its a healthcare site where patients are a custom post type and procedure requests related to each patient are stored in comments on that post. I started off by storing alot of data in commentmeta, but I want an easier way to access it than having to pull from a meta table. I'd also like to be able to use the built-in functions where available (wp_insert_comment can set most of the fields in wp_comments table through the arguments passed to it).

My question is - where are these other values set and accessed in WordPress? Specifically, I'm curious about:

  • comment_karma
  • comment_type
  • comment_approved

I have one meta value I want to set, which I'm hoping to use comment_type for. I also want to set a flag on each request to show whether or not it has been confirmed and responded to. It seems like comment_karma would work well for this, as it is completely unsused, although I'm not sure if it can be set directly with wp_insert_comment.

Are there any consequences I should be aware of when doing this? Would I be better off just adding additional columns to the table, or does this approach sound like it would work?

share|improve this question
    
There was a short movement to remove it for version 3.1 ... but since some systems still hook onto it, it's staying there for now. –  user19256 Aug 14 '12 at 20:59
add comment

2 Answers

up vote 7 down vote accepted

comment_karma

This field is used by a few plug-ins to help you manage your comments. There are a few good articles explaining its exact use floating around on the Internet. But you should note that this field is actually just not used. As Mark Jaquith said once, it's a "there if you want to use it this."

There was a short movement to remove it for version 3.1 ... but since some systems still hook onto it, it's staying there for now.

comment_type

Is this a comment, a trackback, or a pingback? This helps theme devs separate out the different types of "comments" in the front-end display.

comment_approved

Is the comment pending moderation, spam, or approved by the author? Just helps you manage what is and isn't OK for display on the site.

share|improve this answer
add comment
  • comment_karma - no idea, doesn't seem meaningful in current code;
  • comment_type - this marks pingbacks/trackbacks, empty for normal comments;
  • comment_approved - approval (0 or 1) and spam (spam) status.

On your usage - why not just create custom post type for procedures? Comments are much less flexible than posts and kinda single-purposed in nature.

share|improve this answer
    
I found you can set comment_karma through wp_insert_comment() - so that's good for me. I thought about a custom post type, but the structure of comments (threaded, built-in capabilities, and automatically tied to a post) was so close to what I needed, I hoped not to have to reinvent that wheel. –  goldenapples Jan 6 '11 at 20:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.