Articles of comments

Redirect to page 2 after comment

I would like to have commenters going to the page 2 of a paginated post. My posts are separated by the <!–more–> tag so i have the www.site.com/post-title and www.site.com/post-title/2/. I want users to visit the second part of the post after commenting. I found other questions explaining how to move the user to the […]

On WordPress 4.4, how to get the post id using the comment_post hook

Since WordPress 4.4, it seems like it is no longer possible to use get_the_ID() or the_ID() when hooking onto the comment_post action. How can I get the post_id when a new comment is saved?

Show comments in a popup

I want to show comments in a popup for the page with id=22. This is the anchor on whose click the popup will open: <a class=”button button-small button-line-light comment-popup” href=”<?php echo get_stylesheet_directory_uri();?>/comments-detail.php”>View All</a> If I have plain html in comments-detail.php, popup shows the html. But when I try to get the comments list of page […]

How to not load comments form on post preview?

I need a way not to load the comments form when previewing a post, is there a way to achieve this? How? If you need a reason to help: I use disqus and it generates a url for the “discussion” the first time the comment form loads, if this is the preview then it will […]

How to return 404 when called edit-comments.php?

I removed the edit-comments.php link from the backend but I can still access to it when I know the link ./wp-admin/edit-comments.php. How can I deactivate this link as well and return a HTTP 404?

Sort/list/arrange comments by comment author in un-nested/no thread comments

I’ve looked far and wide and found nothing about this. I’m wondering if it’s possible to sort/arrange all the front end comments, in an un-nested comment by comment author?

How stop the process of submitting a comment if a field is empty?

I have a comment form and in that comment form I’ve added an extra input field called with the name ‘review_title’. When one submits the comment form the comment it’s gets inserted perfectly fine and the extra field gets inserted into the comment meta. Want I want to achieve is a server side check when […]

Hide notifications regarding new comments

This is a follow-up on this question. I have now added the code from this page and it helped hiding comments pertaining to the other authors. Now I only need to have the notification removed, as it shows up for other authors than the ones to whom the comment is addressed: Is that even possible?

add_filter comment_edit_redirect not working

In my plugin, I have this statement add_filter( ‘comment_edit_redirect’, ‘mcd_return_link’); and this function function mcd_return_link { return “edit-comments.php”; } Inside the comments.php (core file), is this section of code (within the section to edit comments, around line 310) (version 4.720 $location = ( empty( $_POST[‘referredby’] ) ? “edit-comments.php?p=$comment_post_id” : $_POST[‘referredby’] ) . ‘#comment-‘ . $comment_id; […]

Bots posting comments on pages

I’m wondering how it’s possible for a bot to post a comment on page where there is no call to the comments template in the template that the page utilizes? The only place that I’m calling the comments template is on single blog posts but the bots don’t seem to care to post spam there. […]