Comment problems

After the upgrade my comments stopped working correctly. The comment form didn’t showing the Name, Email, and Website fields and would accept a comment without enforcing the mandatory Name and Email entries.

It seems that the $User_ID constant is always returning a value, even when there is no one logged in. I’ve applied a temporary hack to work around the problem (see below), but I’m going to have to look deeper to identify what is causing it.

Temporary hack follows:

File: /WP-HOME/wp-content/themes/YourTheme/comments.php
(assuming it’s based on the default theme)

Change line 74 from: <?php if ( $user_ID ) : ?>
to: <?php if ( FALSE ) : ?>

File: /WP-HOME/wp-comments-post.php

Change line 26 from: if ( $user_ID ) :
to: if ( FALSE ) :

Change line 37 from:
if ( get_settings('require_name_email') && !$user_ID ) {
to: if ( get_settings('require_name_email') && TRUE ) {

As I said, this just masks the fact that WP thinks that there is a user logged in when there isn’t. I’ll have to look deeper to identify the root cause… don’t wait up.

One thought on “Comment problems

  1. Hi Guys since last three day I am facing a Huge Problem on my blog, The comments form is
    not working. I tried to revert all the possible changes.
    Whenever someone tries to send a comment, it takes them to a blank wp-comments-post.php
    Any help will be appreciated and rewarded through Paypal…

Comments are closed.