How to add text to comment form #content textarea?

You can filter ‘comment_form_defaults’ to change the textarea. You get an array with the default fields as argument: add_filter( ‘comment_form_defaults’, ‘wpse_67503_textarea_insert’ ); function wpse_67503_textarea_insert( $fields ) { if ( /* your condition */ ) { $fields[‘comment_field’] = str_replace( ‘</textarea>’, ‘EXTRA CONTENT</textarea>’, $fields[‘comment_field’] ); } return $fields; }

User can post only one comment per day on one page

Limiting comments per day and per user is already built into your current query. The only thing missing is a check for the post ID. Here’s a pretty convenient function/template tag: /** * @param int $limit * @param int $time * @param int $ids */ function is_user_limit_reached( $limit = 5, $time = 1, $ids = … Read more

Get threaded comments number

// inside your callback function: static $ancestors = null; $parent = (int) $comment->comment_parent; // Modify INITIAL VALUE here: $init_val = (int) 1; $is_child = false; if ( $parent > (int) 0 ) { $is_child = true; $ancestors[] = $parent; $child_counter = count( $ancestors ) + $init_val; } /* * Only needed in case you want … Read more

Display number of comment replies

In the wordpress codex function reference for comments, it looks like the parameter for the parent is not comment_parent but just parent. Which is weird and inconsistent because the return values are prefixed with comment_.

How can change wordpress comment reply text for specific pages only?

Code is not tested. But theoretically it should work: add_filter(‘comment_form_defaults’, ‘wpse337366_comment_form_modification’); function wpse337366_comment_form_modification($defaults) { // put your condition here if( is_page(‘my-page’) || is_singular(‘my_post_type’) ) { $defaults[‘title_reply’] = __(‘Leave a Review’); } return $defaults; } You can place the code in a plugin or your theme’s functions.php. The code will filter the default texts passed to … Read more

Does Akismet plugin expose any hooks, functions, class that can work with custom code?

I greped a slightly aging copy of the Akismet plugin and these are the hooks I found– filters first, then actions. admin.php:374: if ( apply_filters( ‘akismet_show_user_comments_approved’, get_option(‘akismet_show_user_comments_approved’) ) == ‘true’ ) { akismet.php:144: $akismet_ua = apply_filters( ‘akismet_ua’, $akismet_ua ); akismet.php:201: if ( $incr = apply_filters(‘akismet_spam_count_incr’, 1) ) akismet.php:336: $akismet_nonce_option = apply_filters( ‘akismet_comment_nonce’, get_option( ‘akismet_comment_nonce’ ) … Read more

How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form

add_filter( ‘cancel_comment_reply_link’, ‘__return_false’ ); See /wp-includes/comment-template.php#function get_cancel_comment_reply_link() for more background. But if you do that the reply form will not move to the comment. The more interesting question is: Why doesn’t the link work for you? Do you have this line in your footer? is_singular() and get_option( ‘thread_comments’ ) and wp_print_scripts( ‘comment-reply’ );

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