Custom comment link

You could try to add your own custom get_comment_link filter just before you call the wp_list_comments() function: // Modify comment links add_filter( ‘get_comment_link’, ‘wpse_comment_link’, 10, 4 ); // Display comments wp_list_comments( $args, $comments); where our callback is defined as: function wpse_comment_link( $link, $comment, $args, $cpage ) { // Only run it once remove_filter( current_filter(), __FUNCTION__ … Read more

Custom comment field not showing when logged-in

I’m not sure I fully understand your question, but to add some HTML (just over or under the submit field) that is visible to both logged-in and logged-out users, you can try the following: add_filter( ‘comment_form_submit_field’, function( $submit_field ) { //———————————– // Adjust the prepend to your needs //———————————– $prepend = ‘<p> Prepend some HTML … Read more

The comment could not be saved. No comment_ID on comments

I had the same problem and it was indeed solved by turning on Auto_Increment (A_I) for “comment_ID”. Here’s how to do that: https://stackoverflow.com/questions/5665571/auto-increment-in-phpmyadmin In my case, “comment_ID” was not set as a Primary Key and I received an error (1075). It was easily fixed by assigning a Primary Key to “comment_ID”. See this: https://stackoverflow.com/questions/19198397/mysql-how-to-set-the-primary-key-on-phpmyadmin

How to make comments private for commentor and post author

You can use the pre_get_comments filter to modify the parameters of the comment query before it fetches the comments. Specifically the author_in parameter. I tried to write an example, though I haven’t tested it, but it would be similar to this: add_action( ‘pre_get_comments’, ‘author_and_self_comment_filter’ ); function author_and_self_filter( \WP_Comment_Query $query ) : void { // We … Read more

Embedding Youtube video on comments

Just add the comments to oEmbed. Here’s a small plugin that you can use as MU-Plugin or normal plugin and that should explain what’s going on pretty well. <?php defined( ‘ABSPATH’ ) or exit; /* Plugin Name: (#105942) oEmbed Comments */ add_filter( ‘comment_text’, ‘wpse_105942_oembed_comments’, 0 ); function wpse_105942_oembed_comments( $comment ) { add_filter( ’embed_oembed_discover’, ‘__return_false’, 999 … Read more