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 make custom comment fields required and message field not required

Here is a related question that should answer yours. Basicly you want to use the pre_comment_on_post hook function custom_validate_comment() { //validate for brief and rating if( empty( $_POST[‘brief’]) || empty( $_POST[‘rating’]) ) wp_die( __(‘Error: you must fill in both the rating and the brief’) ); //make comment not required if(empy($_POST[‘comment’]){$_POST[‘comment’] == “empty_comment”;} } add_action(‘pre_comment_on_post’, ‘custom_validate_comment’); … Read more

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