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

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()

Comment field override

Actually, comment_field should be outside the $fields array. It is treated separately from the group of other fields. So, when i call comment_form(), i have to pass $fields array as one argument and then comment_field as another one. This way the system will override the default comment field.

Comments/Discussion Not enabled on newly created posts/pages

It could be a plugin that is modifying comment settings. First place to look. Then look at a new post/page. Are comments enabled for that page by default? (On the page/post edit screen, use ‘screen options’ to ensure that ‘comments’ checkbox is enabled, so you see that setting underneath the post content area.) Do you … Read more

Check if comment author has url

Solution Thanks to shanebp answer here <?php if( get_comment_author() == get_comment_author_link() ) comment_author_link(); else echo ‘<a href=”https://wordpress.stackexchange.com/questions/314265/site.com/go?url=”. get_comment_author_url() .”” target=”_blank”>’. get_comment_author() .'</a>’ ?>

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