Sort comments by karma

Just incase if you have not checked out the plugin developers page but heres something that you could try if (function_exists(ckrating_get_comments)) { $post_id = $post->ID; $mycomments = ckrating_get_comments( “post_id=$post_id&status=approve& orderby=comment_karma&order=DESC”); } else $mycomments = null; wp_list_comments(array(), $mycomments); UPDATE I got it working placing in functions.php I got it working placing in functions.php `function comment_comparator($a, $b) … Read more

How to hack recent comments default widget?

Sounds like you just need to make another widget of your own in a plugin. So copy the complete code from the default widgets file, and change the class name, then just edit the code you’d like to edit. class YOUR NEW WIDGET NAME extends WP_Widget { // … foreach ( (array) $comments as $comment) … Read more

Add action on delete comments?

Look at the function wp_delete_comment(). It fires an action before the comment is deleted: /** * Fires immediately before a comment is deleted from the database. * * @since 1.2.0 * * @param int $comment_id The comment ID. */ do_action( ‘delete_comment’, $comment_id ); … and one after deletion: /** * Fires immediately after a comment … Read more

How can I retrieve comments from last 5 minutes for a post?

Note that the function wp_list_comments() doesn’t fetch the comments, only displays them in various ways depending on the input arguments. You’re actually using the WP_Comment_Query/get_comments input arguments into wp_list_comments(). You could try this instead: $postID = 12345; // Adjust this! $comments = get_comments( [ ‘date_query’ => [ ‘after’ => ‘5 minutes ago’, ‘inclusive’ => true, … Read more

How do I get the latest note on the order at woocommerce? [closed]

The order notes are saved as post comments, so you can use the WordPress function get_comments() to get the last note: $args = array( ‘post_id’ => $order_id, ‘orderby’ => ‘comment_ID’, ‘order’ => ‘DESC’, ‘approve’ => ‘approve’, ‘type’ => ‘order_note’, ‘number’ => 1 ); remove_filter( ‘comments_clauses’, array( ‘WC_Comments’, ‘exclude_order_comments’ ), 10, 1 ); $notes = get_comments( … Read more

Comments Confusion

styles.css > line 537: (span.poster-roles) You haven’t defined … any offset to differ between author and admin for the sprite (author/admin) any additional class to make a difference between author/admin It seems that you wanted to only add the graphic for registered authors and admins (there’s nothing for guests). You’ll need to add … (on … Read more

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