Articles of comment meta

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, the data is stored in the wp_posts table, and the post metadata is […]

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 this case ‘get_the_title($post->ID)’ returns post title on one language as expected. function kvkoolitus_email_comment_posted( $comment_ID, $comment_approved ) { if( 0 === […]

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’ => $post->ID, ) ); foreach( $comments as $comment ) { update_comment_meta( $comment->comment_ID, ‘accepted’, ‘0’ ); } But is there a more elegant […]

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() || is_attachment() || is_page() ) { // post, page, attachment update_post_meta($id, $meta_data, $meta_value); } elseif (is_author()) { // author page update_user_meta($id, $meta_data, […]

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 create the next comments one by one. My code goes something like this now. This doesn’t work […]

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 comments: <?php wp_list_comments(‘type=comment&callback=format_comment’); ?> In my functions.php I format the comment: function format_comment() { ?> […]

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 not save. These fields will not appear on comment reply or if review are not enabled for a certain post or page. If these […]

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 stored in comments on that post. I started off by storing alot of data in commentmeta, but I want an […]

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-admin/edit-comments.php so it will not display any comments which has the certain meta keys (e.g. meta1, meta2) in […]

How to customize WordPress twentytwelve_comment function

Is there any way to customize wordpress twentytwelve_comment function to change default comment author meta details.