Make WordPress Core

Opened 3 weeks ago

Last modified 9 days ago

#62393 assigned enhancement

doing it wrong for user used too early

Reported by: kkmuffme's profile kkmuffme Owned by: swissspidy's profile swissspidy
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: Users Keywords:
Focuses: Cc:

Description

Inspired by https://core.trac.wordpress.org/ticket/44937 specifically https://core.trac.wordpress.org/ticket/44937#comment:33

That means it causes the current user to be set up too early.

I guess we should add the same doing it wrong that was added for translations when someone tries to load the user early in other cases too?
Essentially where we now have in function _wp_get_current_user() {

<?php
$user_id = apply_filters( 'determine_current_user', false );

What do you think?

Change History (3)

#1 @kkmuffme
3 weeks ago

If we want to report all of them, it would have to be at the beginning of _wp_get_current_user() since that filter above would only run once for most requests

#2 @desrosj
3 weeks ago

  • Owner changed from swisssspidy to swissspidy

#3 @swissspidy
9 days ago

This sounds like a duplicate of #43869 to me.

Note: See TracTickets for help on using tickets.