[wp-trac] [WordPress Trac] #62322: Global styles: preload user global styles based on user caps in the Post Editor

WordPress Trac noreply at wordpress.org
Wed Oct 30 01:09:25 UTC 2024


#62322: Global styles: preload user global styles based on user caps in the Post
Editor
-------------------------+-----------------------
 Reporter:  ramonopoly   |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  6.8
Component:  Editor       |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch
  Focuses:               |
-------------------------+-----------------------
 A ticket to track the syncing of
 https://github.com/WordPress/gutenberg/pull/66541

 == What
 For the Post Editor, preload `'/wp/v2/global-styles/' . $global_styles_id`
 with a context corresponding to user caps, that is, `'edit'` for users
 that can edit global styles, and `'view'` for everyone else.

 == Why
 Preloading the global styles endpoint according to role context means that
 admins and non admins, e.g., editors, avoid unnecessary clientside
 requests.

 [https://github.com/WordPress/gutenberg/blob/update%2Fglobal-styles-
 preload-paths-remove-6.6-compat/packages/editor/src/components/global-
 styles-provider/index.js#L87-L87, Different clientside requests fire] for
 each.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62322>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list