Completely disable comments

The following is the list of hooks used by Frank Bultge’s plugin Remove Comments Absolutely: # Set the status on posts and pages – is_singular () add_filter( ‘the_posts’, array( $this, ‘set_comment_status’ ) ); # Close comments, if open add_filter( ‘comments_open’, array( $this, ‘close_comments’), 10, 2 ); add_filter( ‘pings_open’, array( $this, ‘close_comments’), 10, 2 ); # … Read more

WP_Query sort by comment meta data

I solved my problem by adding a hook on the action wp_insert_comment. When my hook is called i calculate the average rating for each rating meta-tag of my comments. Then i add a meta tag to the post with the result I can use the post meta-tag to sort with wp-query

Get posts with condition on comment meta value

You can first try the following comment query: $comments = get_comments( [ ‘post_type’ => ‘projects’, ‘post_status’ => ‘publish’, ‘type’ => ‘message’, ‘date_query’ => [ [ ‘before’ => ‘5 days ago midnight’, ‘inclusive’ => true, ] ], ‘meta_query’ => [ [ ‘key’ => ‘foo’, // <– Adjust to your needs! ‘value’ => ‘bar’ // <– Adjust … Read more

Filtering comment permalinks when a condition is met

I’m not completely sure what you are trying to accomplish, but here’s what I think. Normally you would generate a link to a comment like this: echo ‘<a href=”‘ . get_permalink($comment->comment_post_ID) . ‘#comment-‘ . (strval($comment->comment_ID)) . ‘”>’; The problem with filtering get_permalink() is that the filter must know that it is called by the comments … Read more

How to enable reply on most-deeply-nested comments?

Here’s one suggestion using the comment_reply_link filter to change the reply links. Instead of using a regular expression to change it, I think it’s easier to just construct the links again. Here I use the same code as used in the get_comment_reply_link() core function, but I replace the $comment->comment_ID with $comment->comment_parent when the following condition … Read more

Exclude internal links from comment moderation?

The comment_max_links_url filter We can count the number of internal links in the comment’s content and subtract that from the total number of links found there ($num_links), with the help of the following filter inside the check_comment() core function: /** * Filters the number of links found in a comment * * @since 3.0.0 * … Read more

How can I manage all multisite pending comments in one place?

I haven’t tried it. but this plugin looks like it satisfies your alternative option http://wordpress.org/extend/plugins/mu-manage-comments-plugin/ Conveniently shows a list of blogs with spam or unmoderated comments so that the Network Administrator can manage the the comments on network blogs. The list shows counts by blog with links to each comment. However. the plugin warns that … Read more

How to Auto Approve Comments on a Specific Page?

Considering that in Settings > Discussion you have this options checked: The first is comment_moderation and the second comment_whitelist. Then, it is possible to selectively disable them using the filter pre_option_(option-name), as follows: add_filter( ‘pre_option_comment_moderation’, ‘wpse_72990_auto_aprove_selective’ ); add_filter( ‘pre_option_comment_whitelist’, ‘wpse_72990_auto_aprove_selective’ ); function wpse_72990_auto_aprove_selective( $option ) { global $post; if( $post->ID == 2 ) return 0; … Read more

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