Comments form custom fields order

Demo – Setup Here’s a demo how we could control the display of comment fields and their order: Let’s create a custom class: $mycf = new MyCommentFields; Then we define our extra fields: $myfields = []; $myfields[‘myaddress’] = sprintf( ‘<p class=”comment-form-myaddress”> <label for=”myaddress”>%s <span class=”required”>*</span></label> <input id=”myaddress” name=”myaddress” type=”text” size=”30″ tabindex=”5″ /> </p>’, esc_html__( ‘Address’, … Read more

Customize reply form different to comment form

Luckily, I was able to solve this. The problem was in #comments ul li p, so I deleted the margin and text-align properties from there, which were conflicting with the reply comment form, and modified other parts of the css file to achieve the same result. The solution might vary in other cases, but I … Read more

Change language of comments template

There are two options: Replace all default strings for the comment form. Look at wp-includes/comment-template.php for available filters (there are many). Set your blog’s default language to English, install the plugin WP Native Dashboard, load the Italian language files and set the admin language to Italian. Here is a screen shot of the plugin settings:

How can I change the label “Comments” to “Review” everywhere in the WP installation without translation

You can try the gettext filter. According to the Codex: This filter hook is applied to the translated text by the internationalization functions (__(), _e(), _x(), etc.). This filter is always applied even if internationalization is not in effect, and if the text domain has not been loaded. Here’s an example: function custom_gettext( $translated_text, $untranslated_text, … Read more

Only display posts with comments

I ran into this same problem recently and developed a good solution that maintains paging (which some of the answers here do not) and also allows for only targeting certain comment types and comment approved statuses. function has_comments_join( $join, &$wp_query ) { global $wpdb; if ($comment_term = $wp_query->get(‘post_has_comments’)) { $join .= $wpdb->prepare(” JOIN $wpdb->comments ON … Read more

Get all commenters on a post

I’m a little unclear as to exactly the final data you’re looking for. You said “array form”, but that’s not specific enough. So based on your code snippet, this code will provide you an array of all unique commenter user IDs. The code is essentially the same as yours, but I’ve combined a few parts … Read more

Load custom formatted comment with AJAX: reply link isn’t rendered?

It appears you can get max_depth from the options via get_option(‘thread_comments_depth’): function prefix_submit_ajax_comment(){ $comment = wp_handle_comment_submission( wp_unslash( $_POST ) ); …handle errors and get $comment_depth… $GLOBALS[‘comment’] = $comment; $GLOBALS[‘comment_depth’] = $comment_depth; $args[‘max_depth’] = get_option( ‘thread_comments_depth’ ); // solution op_format_comment($comment, $args, $comment_depth); }

Passing arguments to wp_list_comments callback function

Finally I figured it out. you may simply add your arguments to the wp_list_comments as associative key => value pairs like this: $args = array( ‘callback’ => ‘my_callback’, ‘avatar_size’ => 48, ‘type’ => ‘comment’, ‘arg1’ => $arg1 ); wp_list_comments( $args ); and then in your my_callback you have: function my_callback( $comment, $args, $depth ) where … Read more

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