[wp-trac] [WordPress Trac] #53915: Add show show_in_rest param to register_sidebar

WordPress Trac noreply at wordpress.org
Fri Nov 5 02:14:21 UTC 2021


#53915: Add show show_in_rest param to register_sidebar
--------------------------------------+--------------------------------
 Reporter:  spacedmonkey              |       Owner:  TimothyBlynJacobs
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  5.9
Component:  REST API                  |     Version:  5.8
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  rest-api
--------------------------------------+--------------------------------
Changes (by TimothyBlynJacobs):

 * owner:  (none) => TimothyBlynJacobs
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"52016" 52016]:
 {{{
 #!CommitTicketReference repository="" revision="52016"
 REST API: Allow sidebars and their widgets to be public.

 By default, only users with the `edit_theme_options` capability can access
 the sidebars and widgets REST API endpoints. In this commit, A new
 `show_in_rest` parameter is added to the `register_sidebar` function. When
 enabled, all users will be able to access that sidebar and any widgets
 belonging to that sidebar.

 This commit reduces the `context` for a widget's `instance` information to
 only `edit`. This is to ensure that internal widget data is not
 inadvertently exposed to the public. A future ticket may expose additional
 APIs to allow widget authors to indicate that their instance data can be
 safely exposed. REST API consumers intending to access this `instance`
 information should take care to explicitly set the `context` parameter to
 `edit`.

 Props spacedmonkey, zieladam.
 Fixes #53915.
 }}}

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


More information about the wp-trac mailing list