Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#37879 closed defect (bug) (invalid)

On author.php page is_user_logged_in() return issue

Reported by: Aamir.cs Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: Users Keywords:
Focuses: Cc:

Description

Hello,

We are Theme development team. We faced a problem during the development of theme. Issue is at author.php is_user_logged_in() does not work properly. When we logged in and check is_user_logged_in() function at author.php its return "true" its OK, But when we logged out then still its return "true".

And Second is

We are developing a users based directory and we need author.php for user detail page. Example there are two users USER-A with ID-330 and USER-B with ID-331, and USER-A is logged in when USER-A reached USER-B detail page(on author.php) and check get_current_user_id() it returns us 331. It returns current user ID not logged in user ID.

I think there should be a session which store current logged in user. And on author.php it should not overridden with current user ID.

It is very critical issue while developing a user base website. Other way can be a custom templates for user but i think it would not be a best practice.

We are waiting your kind response.

Thank You

Attachments (1)

user-issue.png (300.0 KB) - added by Aamir.cs 5 years ago.
Logged in user issue at author.php

Download all attachments as: .zip

Change History (2)

@Aamir.cs
5 years ago

Logged in user issue at author.php

#1 @johnbillion
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi @Aamir.cs.

I've tested this behaviour using the default theme (Twenty Sixteen) and is_user_logged_in() correctly returns false when viewing an author archive. It's most likely that your theme's author.php file is overwriting the $current_user global which is used to determine the current user.

If you can't get to the bottom of the problem, you should post a thread in the Support Forums or on WordPress Stack Exchange.

Note: See TracTickets for help on using tickets.