Questions tagged [comment-meta]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11 votes
1 answer
1k views

Find out which moderator approved comment?

Is there any way to find out what moderators have approved a comment, and then display that information on the front-end? e.g. John says: "This is a great article" - Approved by Admin1
James's user avatar
  • 111
7 votes
2 answers
10k views

What for is the table "wp_commentmeta" exactly?

I have been reading about the Database Description of Wordpress. I haven't understood the meaning to the use of the table wp_commentmeta. The documentation says: Each comment features information ...
Enrique Moreno Tent's user avatar
6 votes
2 answers
1k views

Lack of composite indexes for meta tables

Why wp_commentmeta table does not have a composite index (comment_id, meta_key) by default? I believe it's the only useful index for that table, am I wrong? Instead, it has a strange set of indexes: ...
Dmitry Isaev's user avatar
4 votes
1 answer
586 views

Adding another state (spam, reject, approve) to wordpress comments?

i know this might sound a bit weird, but what I'm trying to do is rather simple in mind but may be technically difficult. I'm running small contests on my wordpress site where I ask users to leave a ...
mathiregister's user avatar
4 votes
2 answers
2k views

Running a function on comment status change

I am making a review system where i need to find update rating average when: A comment gets approved from pending/trash/spam. A comment gets upapprove from approve A admin post reviews (auto approved)...
Sisir's user avatar
  • 7,772
3 votes
1 answer
8k views

Is it possible to show custom comment metadata in the admin panel?

I've customized my comment form with a new field (city, but that doesn't really matter). I've hooked and filtered and added my comment metadata with add_comment_metadata. I want to show that metadata ...
ageektrapped's user avatar
3 votes
1 answer
2k views

change the comment time output to: X time ago instead of actual date and time

<?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?> Above is the default code that exists for comments.php in the WP Core. This will produce an Output like this: ...
WordCent's user avatar
  • 1,827
3 votes
1 answer
3k views

Query & Sort Comments by custom comment meta

I added a basic "favorite/recommend" functionality for posts and comments to a wordpress site I'm working on. I'm storing the total numbers of comment "likes" in a custom comment meta field (...
ximi's user avatar
  • 131
2 votes
5 answers
3k views

How to get the average of the values from the comment meta

I used the comment meta to add a simple rating system. The user can post a rate from the comment form from where I added 3 dropdown comment meta. The rating is working well, reflecting the ratings ...
user5233's user avatar
2 votes
1 answer
3k views

Add a drop down list to comment form?

Can somebody help me to create a drop-down menu or (radio buttons) in Wordpress comment form, so that a new user could make a selection of their user roles (for example teachers + students) ? Output ...
Daniel Foltynek's user avatar
2 votes
1 answer
3k views

Upload images with comment

EDIT: I finally got the right answer; see my own answer beneath this post for everyone that's interested. After searching for a couple of days and trying over and over again I really got stuck. I'...
Dennis Hunink's user avatar
2 votes
1 answer
4k views

Wordpress Comment. Need some details of wp_comments DB table

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. ...
Sisir's user avatar
  • 7,772
2 votes
1 answer
216 views

How would I count the number of times a comment meta field's value is in a post's entire comments?

How would I count (and display) the number of times a comment meta field's value is a post's entire comments? e.g. meta key is "fish" and key value "shark" appears in 5 comments of a post.
Pete's user avatar
  • 998
2 votes
1 answer
934 views

Wpdb query for comment meta for current post

I have a comment meta field that displays a rating for each comment, I was wondering if there is any way I can query the database to get the sum total of these ratings for each post. I have included ...
tonykhan's user avatar
2 votes
2 answers
2k views

How to change title attribute returned by comments_popup_link()?

I can change label of comments by altering Comment(s) from parameter of following function: comments_popup_link('No Comments;', '1 Comment;', '% Comments;'); But, seems that title attribute is ...
user931's user avatar
  • 321
1 vote
2 answers
19k views

Add Comment Custom Field

I searched a lot of thread regarding my problem, but unfortunately I found nothing works, and this my final option. I want to add some custom fields on my comment form. How can I do that?
markyeoj's user avatar
  • 507
1 vote
1 answer
416 views

How to update Post Meta values through the comment system

I'm working on allowing users to rate posts - through the comment meta. Storing and displaying individual ratings is working, however, I would like to be able to store the average rating in the post ...
maarten's user avatar
  • 25
1 vote
1 answer
197 views

show the meta values to visitors that collected via coment form

in stackoverflow (here) there is a solution for collecting extra information from visitors, and i want to ask that, is it possible to show the collected information to other visitors in his/her ...
Alper's user avatar
  • 183
1 vote
2 answers
2k views

count number of user comments with a specific comment meta value

I am using the code below to count the number of comments by a certain user: global $wpdb; $count = $wpdb->get_var( 'SELECT COUNT( comment_id ) FROM '. $wpdb->comments .' ...
whiteletters in blankpapers's user avatar
1 vote
1 answer
214 views

Storing Comment Meta as an Array

I need to add multiple checkboxes to a post comment form (a Woocommerce product review form, to be exact) that allows people to choose which health condition the product is best for. Upon choosing X ...
Lee Peterson's user avatar
1 vote
1 answer
600 views

Get comments from post and sort by commentmeta value

I want to get all of the comments for a given post and return them in order by a meta_key's value desc high to low. Doesnt look like i can do this with get_comments() like i would like to. This will ...
estern23's user avatar
  • 173
1 vote
1 answer
201 views

How can I get values count from wp_commentmeta?

I am using ACF Plugin in my wordpress site, and I have added radio buttons in comment form, like reactions. it's saving results in wp_commentmeta like this; it's working very good but I want to ...
Ayd In's user avatar
  • 13
1 vote
1 answer
1k views

How to sort posts by the average of comment meta values

Here's the situation- I've customized the comment submission whereby users can provide a rating, and this gets stored as a meta value in the commentmeta table. I can query to return the average ...
elleeott's user avatar
  • 315
1 vote
1 answer
100 views

How to customize Wordpress twentytwelve_comment function

Is there any way to customize wordpress twentytwelve_comment function to change default comment author meta details.
PARVINDER's user avatar
1 vote
1 answer
953 views

Filter out comments with certain meta key/s in the admin backend

Not long ago I learned how to add and filter comments on posts/pages with certain meta key/value and it works fine now. Now what I want is to do two things on the backend (/wp-admin): Filter the /wp-...
58YtQ2H83m17838963l61BU07Y8622's user avatar
0 votes
3 answers
2k views

What are the additional fields in wp_comments used for?

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 ...
goldenapples's user avatar
  • 9,236
0 votes
1 answer
3k views

How to get a value from comment meta

I've add the field country in the comment form. Working nice and I can see the value in the table commentmeta. Now I try to display this value in my comment list. In my single.php I call the list of ...
jjj's user avatar
  • 119
0 votes
1 answer
29 views

Name of comment field differs on different sites

I have a question regarding the „name“ of the comment field of wordpress blogs. I have 2 sites, that are just available locally on my LAN. On the first site, if I inspect the comment field in firefox, ...
mathse's user avatar
  • 11
0 votes
1 answer
170 views

How is the author's name given a different color?

Author's and visitors' names use the same color in comments.The point here is that the color of the author's name is different in the comments. For example, in visitor comments, name is red. But, the ...
A. Muller's user avatar
0 votes
1 answer
28 views

Make every comment go to the spam folder

Wordpress comments exists in 4 states: 0 not approved 1 approved Trashed Spam When a user makes a comment it will end up in the 0 not approved folder, or if it's a spam comment directly to the spam ...
Benjamin's user avatar
  • 155
0 votes
1 answer
71 views

How to put this result inside that result?

I want my comment results to put inside anoher result. I want this result $args = array( 'post_id' =>$post->ID, 'status' => 'approve', ...
Bikram's user avatar
  • 338
0 votes
2 answers
446 views

How to display comment meta under each comment content

I'm trying to display comment meta under each comment, but I couldn't find which action should I hook in.
Kimsea Sok's user avatar
0 votes
1 answer
301 views

Check if the current user is author of first comment

I am editing the comments.php file for the purpose of my site. I want the comment section to be something like this: only the person who made the first comment and the post author will be able to ...
shafee ul kabir Fahim's user avatar
0 votes
1 answer
159 views

Conditional tag for comments

How can I check if the current loop is a comment? Something like is_comment(). I'm building a custom update_x_meta() function where we update meta data according to the type, example: if ( is_single(...
Christine Cooper's user avatar
  • 8,788
0 votes
1 answer
244 views

Update comment meta for all comments of specific post

Questions says it pretty much ... Is it possible to change the comment meta for all comments of a specific post? I know it probably works like this: $comments = get_comments( array( 'post_id' =&...
GDY's user avatar
  • 428
0 votes
1 answer
1k views

How to get Post title by locale with Qtranslate-X

I need to send 2 emails, when new comment is posted and when new comment is approved. Site is multilingual and uses qtranslate-x plugin. Here is code, which sends email when comment is posted. In ...
anton's user avatar
  • 1,033
0 votes
1 answer
277 views

Use has_filter on comment_post

I hook to comment form (on comment_form_logged_in_after if user is logged in and comment_form_before_fields if not) to add 2 fields (rating and title). These fields can be mandatory or comment will ...
Dudo1985's user avatar
  • 113
0 votes
1 answer
129 views

How does WP decide how to display a page

I am new to WP. I tried reading up as much as I possibly can online, and via browsing through the files. As far as I can tell, no physical pages/links are stored on the disk, so when a page is created,...
EastsideDev's user avatar
0 votes
1 answer
2k views

How can I edit comment meta value before it is saved?

I have introduced a custom field in comments form using add_comment_meta() function. I would like to know if there is a way to edit the data of the comment meta just before the post data is saved so ...
Shahrukh Khan's user avatar
0 votes
1 answer
2k views

How to add a category to comments?

I am currently trying to add a category to the comments on my wordpress site. I already added a title to these and tried several ways to add a dropdown (selection) list to the comment form but I am ...
Thierry's user avatar
  • 11
0 votes
1 answer
588 views

get_comment_meta not behaving as expected

I'm sure this must be a silly error by me but I haven't been able to solve it... I added an extra 'rating' field to my comments form so that users can rate posts. Everything works fine and by using ...
Alex's user avatar
  • 131
0 votes
1 answer
481 views

An action hook where a comment meta is updated

By analogy to the hook on post meta update, I use the following code for hooking when comment meta value is updated. My comment meta key is "consider" and can have 2 values: 0 and 1. My Goal is to ...
whiteletters in blankpapers's user avatar
0 votes
5 answers
5k views

How Do I Remove Comment Date and/or Comment Date Link

Found this code in the WP Codex but not sure how to use it to remove the hyperlink and/or date from comments. delete_comment_meta( $comment_id, $meta_key, $meta_value );
Haymanpl's user avatar
0 votes
1 answer
209 views

Editing custom fields for comments

I need help with why the save function is not working in the edit_comment hook. Here is the code for the 'comment_post' hook: add_action( 'comment_post', 'save_comment_meta_data' ); function ...
AlxVallejo's user avatar
  • 1,441
0 votes
0 answers
33 views

Best method for comment section associated with different images?

I would like to create a site where users can upload images and then all users can make comments associated with this image. Because users can upload multiple images I cannot make a new wordpress page ...
jdbrown444's user avatar
0 votes
0 answers
20 views

Add functionality to block comment authors in the Comment edit pag

I want to add an additional button to the Comments edit admin page, allowing me to ban the ips or emails in one click. After clicking the button, it should probably lead me to the Comment Moderation ...
karmeljuk's user avatar
0 votes
0 answers
18 views

How to update_comment_meta from checkbox in comments_custom_column?

I've added a custom column to the edit-comments.php page called "Tips". This column includes a checkbox. My question is when you click on the checkbox, how do you trigger the "...
Brian Smith's user avatar
0 votes
1 answer
31 views

Showing Counts on Comment List with Custom Query

I have added a meta value to the comments-meta table that adds a custom 'status' type code (called 'redacted') to a comment. I have used the following code to display a link to display only those ...
Rick Hellewell's user avatar
0 votes
1 answer
89 views

How do I add <div> tags to entire comments, not just their text

Thanks to some wonderful help here at stack exchange, I have built a comment section with a dropdown menu that adds comment_meta to the comments. I currently have a working filter that uses GET to ...
DJZEEGLER's user avatar
  • 119
0 votes
1 answer
254 views

How to filter comments by comment_meta

EDIT: Yay, solved it! I needed to use new WP_Comment_Query( $args ) and set my $args to only include the current post and the meta chosen. Thanks! Thanks to the wonderful help of the community here, I ...
DJZEEGLER's user avatar
  • 119