Custom Comment Types

First of all, please don’t confuse terms. Custom Post Types is a mis-named feature that should really be Custom Content Types. They’re pieces of content that aren’t posts or pages, but live in the same kind of database. Like posts and pages, they can have tags, categories, comments, and other custom meta and taxonomies applied. … Read more

Comment Author Name In Reply Form

The WordPress function comment_form_title works only for users with Javascript disabled or pages without the comment-reply.js JavaScript loaded. WordPress may not fix this limitation at all Two tickets have been opened before and closed without fix. http://core.trac.wordpress.org/ticket/10084 http://core.trac.wordpress.org/ticket/8639 However I managed to get it work for the default twentyeleven theme by using some dirty fixes. … Read more

Set post comments open function

Have you tried go to Posts and checked the box next to the title and in the dropdown “Bulk Actions” choose Edit and then apply, Comments and in the dropdown “Allow”. And also have added the screen in the post edit area on the tab in the header called “Screen Options” and checked the field … Read more

Allowing more elements in comments via functions.php

Here is an example how to allow a commenter to insert HTML5 video into the comment. Both <video> and <source> elements has two allowed attributes. preprocess_comment filter is applied when saving the comment to the DB. See /wp-includes/kses.php for $allowedtags array structure. function myAllowHtmlComments($comment) { global $allowedtags; $allowedtags[‘video’] = array( ‘width’ => true, ‘height’ => … Read more

How can I control the comment counts filtering my CPT replies?

Here are three different methods to modify the trash count, to 999 as an example: Method #1 The views_edit-comments filter: add_filter( ‘views_edit-comments’, function( $views ) { $trash_count = 999; // <– Adjust this count // Override the ‘trash’ link: $views[‘trash’] = sprintf( “<a href=%s>%s <span class=”count”>(<span class=”trash-count”>%d</span>)</span></a>”, esc_url( admin_url( ‘edit-comments.php?comment_status=trash’) ), __( ‘Trash’ ), $trash_count … Read more

Why does comment_reply_link launch the reply form at the wrong spot on the comment section?

Because that’s done in javascript, and you have to enqueue that javascript for it to work, as stated in the docs: If JavaScript is enabled and the comment-reply.js JavaScript is loaded the link moves the comment form to just below the comment. https://codex.wordpress.org/Function_Reference/comment_reply_link e.g. function wpse289875_enqueue_comments_reply() { if ( is_singular() && get_option( ‘thread_comments’ ) ) … Read more

Running a function on comment status change

The comment_post hook is called with a $comment_id as the first argument. You can see why your function is failing. Same goes for the edit_comment hook. Simply add the following at the beginning of your business function: if ( !is_object( $comment ) ) $comment = get_comment( $comment ); Do use a custom SQL query for … Read more

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