List user comments in author page

Try with WP_Comment_Query and make sure you have the right Author ID from the Author Template. // WP_Comment_Query arguments $args = array ( ‘user_id’ => $user->ID, ‘post_status’ => ‘approve’, ‘number’ => ’10’, ); // The Comment Query $comments = new WP_Comment_Query; $comments = $comments->query( $args ); // The Comment Loop if ( $comments ) { … Read more

How to return 404 when called edit-comments.php?

There are several ways you can approach this. I wouldn’t recommend deleting edit-comments.php as this is changing the core files, and your changes will be lost when you update WordPress. htaccess 301 Redirect /wp-admin/edit-comments.php http://www.example.com/wp-admin/ OR functions.php Part 1 // Redirect any user trying to access comments page function custom_disable_comments_admin_menu_redirect() { global $pagenow; if ($pagenow … Read more

How do you override the default comment template?

Now what if you have to add/remove fields from default contact form to change the feel of your comment box? I am eliminating website field from default comment box by playing with ‘fields’ argument:in comments.php <?php $comment_args = array(‘title_reply’ => ‘Got Something To Say:’, ‘fields’ => apply_filters(‘comment_form_default_fields’, array( ‘author’ => ‘<p class=”comment-form-author”>’ . ‘<label for=”author”>’ … Read more

How to not load comments form on post preview?

I took a quick peek at the disqus plugin. This works in disabling the option before the plugin decides to print out the form. add_filter( ‘pre_option_disqus_active’, ‘wpse_conditional_disqus_load’ ); function wpse_conditional_disqus_load( $disqus_active ) { if( is_preview() ){ return ‘0’; } return $disqus_active; } You could also try something like this (not tested) add_filter( ‘the_content’, ‘wpse_load_disqus’); function … Read more

Hide notifications regarding new comments

Based off of the code from another question that you referenced, I’ve added onto it by changing the total number of comment using jQuery: add_filter( ‘the_comments’, ‘wpse_236055_filter_comments’ ); add_action( ‘admin_head’, ‘wpse_236055_comment_notification’ ); function wpse_236055_filter_comments( $comments ){ // Display comments related to the author global $pagenow, $user_ID, $comment_count; wp_get_current_user(); if ( $pagenow == ‘edit-comments.php’ && current_user_can( … Read more

Diplay comment date on WP_Post_Comments_List_Table

So, it doesn’t appear you can do much “properly” to solve this issue, however, you can take some advice from this answer and apply it to your problem: <?php add_filter( ‘get_comment_author_IP’, function( $comment_author_IP, $comment_ID, $comment ) { global $pagenow; if( is_admin() && ‘post.php’ === $pagenow && isset( $_GET[‘post’] ) ) { $comment_date = do_something_to_get_comment_date($comment_ID); $comment_author_IP … Read more

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