Articles of comments

Comment displaying full name even after setting another display name?

I’ve tried everything … Changing the display name of the user: Changing the author name of the comment: But it doesn’t work. The author name of the post is still the user’s full name: Why is this? How to change the author name of that comment to the display name?

How to modify core when there is no hook?

I want to add a custom HTML5 attribute to the <form> element in the comments form. Since the form field itself is generated by comment_form(), and there is no hook to edit within the opening <form>, I’m not exactly sure how to do this? I don’t need to replace the entire comment_form() function– I just […]

How to limit comment author to one comment per post

Is there a way to limit comments to one per post based on the comment author email ? It should work for none logged in users.

How can I edit comment notification email content?

I have to edit the mail content which is default one to send notification to the post author when a comment is submitted. I need to add my custom content by replacing the existing comment mail content. So is there any action or function to override this default email template with mine custom one.

comment_post action hook running on page load instead of after a comment is posted

I am trying to call a function after a comment is saved to the database, see below… add_action(‘comment_post’, ‘myFunction’, 10, 2); do_action(‘comment_post’, $comment_ID, $comment_approved); I have placed this code in my comments.php file. myFunction is defined in functions.php and is shown below function myFunction($comment_ID, $comment_approved){ Analytics::track(‘Posted comment!’); } The problem is that this function is […]

List user comments in author page

I’m trying to display a list of the author comments in the authors page but it only shows No comments made. How can I list user comments in the authors page? <?php $args = array( ‘user_id’ => $user->ID, ‘number’ => 10, // how many comments to retrieve ‘status’ => ‘approve’ ); $comments = get_comments( $args […]

How can I test why the comment hook is not working?

I am trying to perform an action after a comment is approved. What this action is, is to register the commenter automatically using register_new_user, using the commenter’s name as the username, and email as the user email. And a password generated automatically using wordpress and the new user is emailed their user details, which I […]

Log file reports SQL Error processing child comments

I’m seeing a SQL error in my log file that reads like this: [15-Oct-2016 17:34:59 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE AND comment_parent IN (10) ORDER BY comment_date_gmt ASC, comment_ID ASC’ […]

How can I convert anonymous commenters into registered users?

I want to convert all anonymous comments that have already been posted into a registered user using the username and a randomly generated password. I really don’t know where to begin with this. I also want to convert new anonymous commenters into a registered user. If I add a hook into functions.php using register_new_user will […]

Custom WP Comments Query with Nested Comments Possible? (Hierarchy/Depth)

I’ve set up a custom WP Comments Query that serves approved comments on posts ordered by date (basic stuff) and everything works fine except the fact that comments are displayed below each other and I’d like them to be nested — like if I was using wp_list_comments(). Is there any template file/function to output comment […]