How to check if commenter is the_author?

Not sure what you are meaning to do but, if you take a look at the get_comment_class() function that is responsible for generating the .bypostauthor class you can see how it determines if the commenter is the author if ( $post = get_post($post_id) ) { if ( $comment->user_id === $post->post_author ) $classes[] = ‘bypostauthor’; } … Read more

How to add a div on comment fields / edited

The comment_form() isn’t quite correct with your arguments being loaded in. You need to pass in ‘fields’ => apply_filters( ‘comment_form_default_fields’, $fields ), into a new argument. Attached is an example of what you would need to update. Fields you want to have filled out $fields = array( ‘author’ => ‘<div class=”comment-form-author”><label for=”author”>’ . __( ‘Name’, … Read more

Display comment meta data after quick update

I think the action wp_ajax_get-comments is not triggered, if you quick-update the comment. You should check, which ajax request is triggered on the update and then change your code into: if( doing_action( ‘wp_ajax_get-comments’ ) || doing_action( ‘wp_ajax_quick-update-action’ ) ){ … } I am not able to test this code at the moment, but i hope … Read more

Multiple Comment Forms in a single page [closed]

You can pass the number argument to get_comments() to retrieve only a specific number of comments. They will, by standard, be sorted descending, so you get the latest comments first. As WordPress automatically seperates comments for each post, you will not have to worry about mixing comments up. This seems to be the easiest way … Read more

Display commenter’s registration date on comments?

In your wp_list_comments callback function, you can call get_userdata to get any additional comment author data: $userdata = get_userdata( $comment->user_id ); echo ‘Registered: ‘ . $userdata->user_registered; // format the date // Sunday January 13th 2013 echo ‘Registered: ‘ . date( ‘l F jS Y’, strtotime( $userdata->user_registered ) );

How to refresh the page when an admin trashes a comment from Comments in the admin site?

The Comments admin page uses AJAX when trashing a comment via the “Trash” link, but only if the link element (the <a> tag) contains an attribute named data-wp-lists — see the delBefore() function in /wp-admin/js/edit-comments.js. So because the attribute is added via PHP (see line 764 in wp-admin/includes/class-wp-comments-list-table.php), then you can use the comment_row_actions filter … Read more

customize comment form

This code will allow you to customize the comment field labels and will move the comment form below the fields. Add the code to your functions.php or to a plugin. To change the labels, modify the Name CUSTOMIZED, Email CUSTOMIZED, and Website CUSTOMIZED, and Comment * CUSTOMIZED text. /** * Customize comment form default fields. … Read more

SQL query to delete comments older than 90 days?

Regarding comments- what about the case where a comment older than 90 days has child replies younger than 90 days? for comment and pingback status, this should do it: UPDATE wp_posts SET comment_status=”closed”, ping_status=”closed” WHERE post_date < DATE_SUB(NOW(), INTERVAL 3 MONTH) AND post_status=”publish”;

Comments Feed & Custom Post Statuses

Found the filter: comment_feed_where to filter the WHERE clause, which by default only looks for posts with status = publish. function comment_feed_where_status($where) { return str_replace( “post_status=”publish””, “post_status=”publish” OR post_status=”resolved” OR post_status=”unresolved””, $one); } add_filter(‘comment_feed_where’, __NAMESPACE__ . ‘\\comment_feed_where_status’); I found this by debugging with “SAVEQUERIES” enabled and dumping the queries array on the feed page.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)