2022 Developer Survey is open! Take survey.

Questions tagged [comment-meta]

The tag has no usage guidance.

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

comments_where Hook

Is there a similar replacement of the hook posts_where for comments (WP_Comment_Query)? I need to modify the where clause for a comments query like it is shown in this tutorial (“4. Sub custom field ...
user avatar
0 votes
0 answers
13 views

add_comment_meta not working properly

I have a scenario where I need to retrieve a custom field ('current_module') from a comment author's user profile and add it to a custom field ('author_current_module') associated with any comment ...
user avatar
0 votes
1 answer
39 views

How to check if `comment_meta` exists before inserting the comment?

I am inserting comments via wp_insert_comment and while doing so I am adding email replies only. Now, I want to check if the comment is already present or not before inserting and if does exist do not ...
user avatar
0 votes
1 answer
18 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, ...
user avatar
  • 11
0 votes
0 answers
24 views

Add custom field on admin dashboard comments / reviews

I hope someone can shine me some light with regards to the problem I'm solving. Currently we can add comments / reviews on woocommerce products - via dashboard using this form: I can add a default ...
user avatar
  • 101
0 votes
0 answers
37 views

pin a comment to top of comments list

i want to pin all comments from post with commentmeta = 'spolie' on the top of my comment list in post. Quite similar to Instagram pin comment or wpdiscuz pin comment; Can someone help me. tnx :)
user avatar
0 votes
0 answers
30 views

What is the best way to grouping comments in wordpress?

In WordPress, I want to group comments by a numeric value to use each of the groups in a special parts that I want. Any of my groups have a numeric value as identifier. For example, I want to put ...
user avatar
0 votes
1 answer
87 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 ...
user avatar
0 votes
1 answer
27 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 ...
user avatar
  • 155
0 votes
1 answer
71 views

Use country flag as user avatar based on comments IP address?

trying to find the way to allocate a country flags instead using MisteryMan icon, Gravatar or User Avatar. Any help or suggestion about where to start?
user avatar
  • 139
0 votes
1 answer
66 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', ...
user avatar
  • 198
0 votes
1 answer
79 views

Top rated posts Average rating issue

I am trying to show top rated posts, cpt with AVG rating value.I created the custom widget for this. Defaults wp posts data and AVG value is showing correct but a CPT like Movie post not showing ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
0 votes
1 answer
3k 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 ...
user avatar
0 votes
1 answer
106 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 ...
user avatar
0 votes
2 answers
320 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.
user avatar
2 votes
1 answer
166 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.
user avatar
  • 976
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: ...
user avatar
0 votes
1 answer
67 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, ...
user avatar
0 votes
1 answer
219 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 ...
user avatar
0 votes
1 answer
126 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(...
user avatar
  • 8,579
0 votes
1 answer
199 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' =&...
user avatar
  • 388
0 votes
1 answer
336 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....
user avatar
  • 1,003
1 vote
1 answer
152 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 ...
user avatar
  • 13
0 votes
1 answer
36 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. ...
user avatar
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 ...
user avatar
  • 1,003
-4 votes
1 answer
65 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 ...
user avatar
1 vote
1 answer
90 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.
user avatar
0 votes
1 answer
641 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/...
user avatar
  • 153
1 vote
1 answer
855 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-...
user avatar
0 votes
1 answer
160 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 ...
user avatar
  • 1
0 votes
1 answer
252 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 ...
user avatar
  • 103
0 votes
1 answer
127 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,...
user avatar
0 votes
2 answers
391 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 ...
user avatar
  • 176
0 votes
1 answer
1k 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 ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
  • 11
2 votes
1 answer
828 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 ...
user avatar
0 votes
1 answer
537 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 ...
user avatar
  • 131
0 votes
0 answers
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 /***********************...
user avatar
0 votes
2 answers
330 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 ...
user avatar
  • 101
7 votes
2 answers
9k 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 ...
user avatar
0 votes
0 answers
319 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 ...
user avatar
0 votes
1 answer
425 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 ...
user avatar
1 vote
2 answers
1k 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 .' ...
user avatar
0 votes
5 answers
4k 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 );
user avatar
2 votes
1 answer
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 ...
user avatar
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 ...
user avatar
  • 119
4 votes
1 answer
540 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 ...
user avatar
1 vote
1 answer
209 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 ...
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: ...
user avatar