Allow the comment author to delete their own comments
Allow the comment author to delete their own comments
Allow the comment author to delete their own comments
You could try the pre_comment_approved filter to modify the approval status for the $approved = 1 case, excluding the post author and users with moderate_comments capability. Then set it to 0 if the commenter has fewer than 2 approved comments. Note that the approved value can also be ‘spam’ or ‘trash’.
wp_insert_comment is both a hook and a function. Once a comment is left on your blog, this action hook will be triggered, allowing you to modify the comment. A very simple example would be: add_action(‘wp_insert_comment’,’my_function’,100,2); function my_function($comment_id, $comment_object) { // Now you have access to $comment_id, save it, print it, do whatever you want with … Read more
It took a while, but this works (a comment is created, albeit with still some missing values, but fixing that part is easy) Biggest changes: For some reason an ‘echo’ in functions.php was important. Also, I changed the ‘action’ in ajaxtry2.js under data: HTML (values are fictional) <form id=”commentform” class=”commentform”> <label for=”comment”></label> <textarea id=”comment” class=”comment” … Read more
Writing a loop and going through every comment is the option that I can offer you. Take a look at this example: function get_comment_authors($post_ID){ // Get every comment on this post $args = array( ‘post_id’ => $post_ID ); $comment_objects = get_comments( $args ); // Define an empty array to store the comments $author_array = array(); … Read more
Reply By Email to comment notifications
Well, this question is old but still has no answer! Here is a small solution for future visitors. Implementing load more button for comments without plugins is simple enough: Create a button if comment pages are 2 and more Create a jQuery script that will process the button click event and passes the current comment … Read more
Add custom field in comments form
I have checked with 4.9.1 as well as 5.0-alpha there is no problem with ‘\’. Please check it after deactivating all plugins and activating the default theme of WordPress.
For anyone who is having a similar issue, the problem was that the child theme was not registering the custom post type. I had to change the “supports” there for it to work. Not ideal but it’s fixed.