[wp-trac] [WordPress Trac] #55917: Fatal error in WP6.0 when calling get_current_screen on the pre_get_posts action
WordPress Trac
noreply at wordpress.org
Wed Jul 6 10:05:15 UTC 2022
#55917: Fatal error in WP6.0 when calling get_current_screen on the pre_get_posts
action
-------------------------------------+---------------------
Reporter: lumpysimon | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.0.1
Component: Query | Version: 6.0
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+---------------------
Comment (by aristath):
The webfonts API is a scenario where we need to take lots of things into
account... Webfonts need to be properly loaded in the block editor, both
in the normal edit screen and the site-editor, they also need to be
available in REST-API calls for the editor because some styles get added
via REST calls, and they also need to be available in the frontend.
That is why the `wp_loaded` hook was selected... If I remember correctly
it was one of the very few that worked for all cases.
We can try using `wp` (which runs ''after'' `pre_get_posts`), but this
will need to be thoroughly tested to ensure that webfonts are still
properly loaded both in the editors & the frontend. 👍
cc @hellofromTonya, I remember we were discussing this hook a few months
ago
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55917#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list