• Hi folks! Quick question – in my comments.php template, we find the standard check to see whether comment_registration is required and the $user_ID global variable is defined.

    With the template I’m using, $user_ID always seems to be undefined, or I should say, the test always fails, thus users (even when logged in) never get to see the comment form.

    I guess I need to understand where is $user_ID defined? How does WP handle user authentication? In which of the 10 billion includes do we query the user, authenticate him, and pass his ID to this global variable?

    Thanks in advance for any insights you might have!

    Tom

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Tom Auger

    (@tomauger)

    In this case, $user_ID is null because of a domain/cookie issue, best as I can tell. A quick trip to Admin-Options and setting both URLs to the same domain worked.

    Still would love to know which include does the initial query on get_currentuserinfo(); If anyone knows, please post your response! I will check back periodically.

    stilllive

    (@stilllive)

    A quick trip to Admin-Options and setting both URLs to the same domain worked.

    Are there any methods of solving the problem without setting these URLs asame?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    They don’t have to be the same, but they do have to be the same *domain*.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘$user_ID always null’ is closed to new replies.