custom comment fields on CPT

Non-CPT Comments Regarding the first issue: you’re not returning anything if your conditional is false. To simplify your code: function debate_comment_fields( $fields ) { // If conditional is true if( is_singular( ‘debate’ ) ) { // Do some stuff to $fields // Return $fields return $fields; } // If conditional is not true? } add_filter(‘comment_form_default_fields’,’debate_comment_fields’); … Read more

Customizing Comments

Presumably you’ve used wp_list_comments to display the comments. That being the case, what you need to do is create a callback function to format your comments and pass that callback into wp_list_comments like so: wp_list_comments(array(‘callback’=>’mytheme_comment’)); You can use the comment method in the Walker_Comment class as a starting point. That method provides the default output.

Customise Comment form

The default comment form fields are defined like so: $fields = array( ‘author’ => ‘<p class=”comment-form-author”><label for=”author”>’ . __( ‘Name’, ‘domainreference’ ) . ‘</label> ‘ . ( $req ? ‘<span class=”required”>*</span>’ : ” ) . ‘<input id=”author” name=”author” type=”text” value=”‘ . esc_attr( $commenter[‘comment_author’] ) . ‘” size=”30″‘ . $aria_req . ‘ /></p>’, ’email’ => ‘<p … Read more

Wrong IP address in comment section

I assume that by comment you actually mean a trackback/pingback. Those are sent from your server and not your computer and since in this case it sent from your server to itself it probably uses the local IP for the communication. 192.X.X.X is an IP range reserved for local in LAN communication same as the … Read more

What is the earliest hook comment meta can be saved?

If you look at the source for wp_new_comment() there is comment_post action hook, which fires immediately after comment is inserted into database and so is probably what fits your needs. However logically it’s after decision if comment is spam or not, I am not sure how meta is involved in your case since approval status … Read more

WordPress comment for virtual page

WordPress comments are segmented by IDs of their parent posts. For virtual pages you would either have to: replicate the process (by creating underlying Custom Post Type for it) or completely rebuild how it’s handled for them (for example by tracking segments as comment meta and query accordingly)