Today I was doing some research on wordpress comments. I am looking for making a Comment Type which I can use as a review on wordpress custom post type which I use for business directory listings.
Looking at the wp_comments table of wordpress Here is the table fields. Please fill me up for the purpose of each table field (looks at 10, 12, 13):
- comment_ID: ID for the comment
- comment_post_ID: The post for which the comment is posted
- comment_author: Comment author name
- comment_author_email: Author name for the comment
- comment_author_url: Author url
- comment_author_IP: Author IP address
- comment_date: Comment Date
- comment_date_gmt: GMT time of the comment
- comment_content: Contents of the comment (comment body)
- comment_karma: What is this? Does wordpress have any default karma calculation? or its placed for plugin authors
- comment_approved: Flag for the comment status.
- comment_agent: Not sure what it is?
- comment_type: What is it? Can wordpress have a default comment_type functionality like custom post type?
- comment_parent: For threaded comment
- user_id: user id if comment author is a registered user of the site.
I was wondering if i can use wordpress comment table and comment meta table to make the total review system working. The reviewer have to be registered before send review. So that will save lots of work. Also i need to know how the wordpress current comment functions will work with this method. As every comments has its own post id so it think that will not be a problem.
And also when I import the CPT I will also able to import all the comments and fields (if i add some comment meta fields) right?
So, if i sum up my questions are:
- what is 10, 12 and 13 db table field for comments? Does wordpress uses it or I can use it for saving extra information. And How do i use wordpress comment meta table. Any codex page link will be greatly appreciated.
- when I import the CPT I will also able to import all the comments and fields (if i add some comment meta fields)?
1 Answer
Karma is a relic. Unused.
Agent is the browser agent of the person who left the comment. Like saying they use firefox or IE or whatever.
Comment type is either “comment” (or blank for the default case) or “pingback” or “trackback”, basically. You can have custom types, however they generally won’t show up as comments because WP doesn’t know about those types. Adding custom types is possible, but not officially supported yet because the code to support it properly isn’t there.
You’d be much better off storing your type in comment meta for now.