[wp-trac] [WordPress Trac] #55796: SHORTINIT requires rest-api.php via rest_cookie_collect_status() via wp_get_current_user()

WordPress Trac noreply at wordpress.org
Mon May 23 23:11:41 UTC 2022


#55796: SHORTINIT requires rest-api.php via rest_cookie_collect_status() via
wp_get_current_user()
-----------------------------------+------------------------------
 Reporter:  johnjamesjacoby        |       Owner:  (none)
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Application Passwords  |     Version:  2.0
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion            |     Focuses:  rest-api
-----------------------------------+------------------------------

Comment (by TimothyBlynJacobs):

 This is interesting.

 I would agree that the REST API shouldn't be a general `SHORTINIT`
 requirement. Having it end up being required if `wp()` is called is a bit
 more tricky though I think. What I mean by that, is that since the REST
 API is loaded through `wp()`, and we don't have any official way in
 WordPress Core of turning off the REST API, it doesn't seem too odd that
 we'd expect the REST API functions to be available when `wp()` is running.

 That being said, while we don't allow turning off the REST API via a
 filter, it seems sensible to me that a developer using `SHORTINIT` should
 be able to control what bits are loaded including omitting the REST API.

 Would it work to move all of the REST API related hooks that rely on
 functions defined in `rest-api.php` to a `rest-api-filters.php` file that
 would get included after `wp-includes/rest-api.php` in `wp-settings.php`?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55796#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list