wp list all users who haven’t commented on a post

OK, so you want to get set complements from MySQL. One way to do this will be with query like that: SELECT u.ID FROM wp_users u LEFT OUTER JOIN wp_comments c ON (u.ID = c.user_id AND comment_post_ID = <YOUR_POST_ID>) WHERE c.user_id is null But you should remember, that such query won’t be very efficient. So … Read more

Comments counter only for Authors Posts

For the moment just for hiding the comments counter from an author role, i made a small code like that /* * Hide Comments Counter for Author Hook */ if ( ! current_user_can( ‘manage_options’ ) ) { add_filter( ‘comment_status_links’, function( $status_links ) { // Override the original links: $status_links[‘trash’] = sprintf( “<a href=%s>%s <span class=”count”></span></a>”, … Read more

Show comments in Backend

I answered my question coincidentally in the comments section. Just put your self made comments in the right table: wp_comments and everything works like a charm… 🙂

wp_mail doesnt work inside transition_comment_status

* UPDATE * I have placed this function before the prev code // define the wp_mail_failed callback function action_wp_mail_failed($wp_error) { return error_log(print_r($wp_error, true)); } // add the action add_action(‘wp_mail_failed’, ‘action_wp_mail_failed’, 10, 1); Which helped me track the problem (using headers wrong). I share this in the hopes this helpes anyone while debugging wp_mail()

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