how to get the comment ID in the front end when the REPLY button is clicked?

Here are few ideas: It’s possible to inject custom HTML or data attributes via the comment_reply_link filter, but I think it would be better to keep it unobtrusive. One could try to get the comment parent value from the reply comment form: <input type=”hidden” name=”comment_parent” id=’comment_parent’ value=”0″ /> after it has been updated with the … Read more

Making shortcode of filtered number of comments by user role

The code below adds the counts for user roles. It’s commented pretty well to explain what’s happening. It should give you a good starting point for further customization (maybe you want to hide 0 counts, change the HTML output, etc.). function comments_shortcode($atts) { $current_user = wp_get_current_user(); extract( shortcode_atts( array( ‘id’ => ” ), $atts ) … Read more

Disable comments from showing up public for Custom Post Type

Removing Custom Post Types’ comments from Recent Comments Widget The arguments for the recent comments widget can be customized using the widget_comments_args filter. To customize the post types types whose comments will be included, we can customize the $post_type variable: $post_type Post type or array of post types to retrieve affiliated comments for. Pass ‘any’ … Read more

Create a “Reject” action for comments?

It’s currently not that easy to create new comment statuses in WordPress. Comments in WordPress have a field comment_approved which can have a value of 1, 0, spam or trash. In your case I’d probably leverage the existing trash functionality and store the rejection reason as comment meta. That’s similar to how anti-spam plugins like … Read more

How would I count the number of times a comment meta field’s value is in a post’s entire comments?

You should be able to do a meta_query in a WP_Comment_Query(): $args = array( ‘post_id’ => ‘post-id-here’, ‘meta_query’ => array( array( ‘key’ => ‘fish’, ‘value’ => ‘shark’, ‘compare’ => ‘LIKE’ ) ) ); // Query the comments $comment_query = new WP_Comment_Query( $args ); // Count the number of comments $count = count ( $comment_query ); … Read more

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