[wp-trac] [WordPress Trac] #62963: Fatal is_admin_bar_showing() - Call to undefined function is_user_logged_in()
WordPress Trac
noreply at wordpress.org
Fri Feb 14 07:47:19 UTC 2025
#62963: Fatal is_admin_bar_showing() - Call to undefined function
is_user_logged_in()
-------------------------------+------------------------------
Reporter: kkmuffme | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by dd32):
* keywords: => reporter-feedback
Comment:
Calling certain functions before `init` runs is not advised, and can lead
to fatal errors like you've experienced.
`muplugins_loaded` shouldn't be anything other than the very first plugin
bootstrap functionality (such as adding filters), The WordPress user is
not loaded at that time (So you can't check if a user setting is valid),
and `shutdown` occurs after the page may be output to the browser.
To me, it feels like the code you're running might be the problem, and
should be delayed until `init` or later.
Can you provide example code that shows the behaviour in a way which
should be supported?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62963#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list