Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [comment-meta]

The tag has no usage guidance.

0
votes
1answer
43 views

How to get top rated posts using wp query?

I want to get top rated posts using wp query. The rating value is store in comment meta database table when some one post a comment on wp post or cpt.Please screenshot EDIT Here is my code ...
0
votes
1answer
654 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 ...
0
votes
6answers
3k 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 );
2
votes
1answer
2k 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'...
5
votes
2answers
6k 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 ...
0
votes
1answer
184 views

How to add/update post meta to use in query?

I found a rating system that users can rate the post when commenting. Every thing is good but I want to use the average rating of posts to sort them to users based on average rating (in fact be able ...
0
votes
1answer
43 views

Adding Comment Meta to a new comment notification email

I am trying to include a rating comment meta value in the subject line of the email that notifies authors that someone has left a new comment (and, in my case, a rating) on their post. function ...
0
votes
1answer
48 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.
0
votes
0answers
33 views

How to show comment author URL next to comment author?

By default, the comment author links to their URL. But I have changed that to their profile. Front-end profile generated by a plugin. Now when anyone clicks on author name they are redirected to the ...
0
votes
0answers
1k views

Add comment meta

I need to add my custom meta to the new comments. Here is what I've done : /************************************************************************/ /* Add meta to comments /***********************...
2
votes
1answer
43 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.
2
votes
1answer
480 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: ...
0
votes
1answer
42 views

Removing(replacing) avtar in comments.php with some other HTML arrangements

<ol class="comment-list"> <?php wp_list_comments( array( 'style' => 'ol', 'short_ping' => true, ...
0
votes
1answer
113 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 ...
0
votes
1answer
37 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(...
0
votes
1answer
59 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' =&...
1
vote
2answers
11k 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?
1
vote
1answer
5k 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 ...
0
votes
1answer
120 views

Display comment meta data after quick update

I have few custom comment field - phone, stored as comment meta. On comments edit page (edit-comments.php) I display this value in custom column. I also display these values on post edit page (post....
1
vote
1answer
79 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 ...
0
votes
1answer
24 views

Wordpress Commenting System User access and Security

In General, WordPress gives these 5 access types to user → Click Here. Namely, Subscriber Contributor Author Editor Administrator I have a main website to be launched here, and then the blog here. ...
0
votes
1answer
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 ...
-4
votes
1answer
57 views

how to Show BEFORE TEXT before in wordpress get_comment_meta [closed]

I am using a piece of code to show the city output. It is working fine. The code is given here: $city = get_comment_meta( get_comment_ID(), 'city', true ); I want to show Re: text before the output ...
1
vote
1answer
53 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.
0
votes
1answer
332 views

Custom comment action

I have updated my Wordpress version from 4.3.1 to 4.5.2 and apparently it broke a custom function I've made in the past. What it does: Display a anchor below comments, next to Approve/Answer/Edit/...
1
vote
1answer
382 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-...
0
votes
1answer
76 views

Add commentmeta custom field to every published comment with SQL

I am trying to add custom commentmeta "likes" with 0 as default value to every posted comment. I have this query but I dont see any error there, but still it doesnt work. Can anyone help me to solve ...
0
votes
1answer
147 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 ...
0
votes
1answer
119 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,...
0
votes
2answers
234 views

Echo out custom fields in comments

I am trying to figure out how to echo 4 created fields from a plugin in my theme template for the comment form and customize the comments output as well. The plugin I am using lets me add custom ...
2
votes
2answers
1k 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 ...
0
votes
1answer
576 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 ...
2
votes
5answers
2k 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 ...
2
votes
1answer
537 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 ...
0
votes
1answer
414 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 ...
0
votes
2answers
183 views

Retrieve meta_value from add_comment_meta

I have a voting function for comments which needs to display the avatars of the users who voted for a specific comment. I am having trouble getting the user id of the voter ($supporter). All I seem to ...
4
votes
1answer
483 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 ...
0
votes
0answers
275 views

Comment-Meta doesn't work with latest wordpress update

I already had this script working, but since the last update of the wordpress core it doesn't save the comment-meta anymore. /** * Comments Winner */ // Add new heading to comments tables ...
1
vote
1answer
486 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 ...
0
votes
1answer
266 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 ...
1
vote
2answers
752 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 .' ...
2
votes
1answer
2k 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 ...
0
votes
1answer
2k 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 ...
0
votes
1answer
161 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 ...
5
votes
2answers
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: ...
1
vote
1answer
182 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 ...
0
votes
2answers
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 ...
3
votes
2answers
1k 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)...
3
votes
1answer
2k 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 (...
11
votes
1answer
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