WordPress/wp-includes/rest-api
spacedmonkey ec370a0af4 REST API: Improve permission handling in global style endpoint.
The new wp_global_styles post type is registered to use edit_theme_options in the capability settings. The WP_REST_Global_Styles_Controller class's permission checks methods use the capability in a hard coded form rather than looking up the capability via the post type object. Changing the permission callbacks to lookup capabilities via the post type object, allows theme and plugin developers to modify the capability used for editing global styles via a filter and these values to be respected via the Global Styles REST API.

Props Spacedmonkey, peterwilsoncc, hellofromTonya , antonvlasenko, TimothyBlynJacobs, costdev, zieladam.
Fixes #54516.


Built from https://develop.svn.wordpress.org/trunk@52342


git-svn-id: http://core.svn.wordpress.org/trunk@51934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 20:58:00 +00:00
..
endpoints REST API: Improve permission handling in global style endpoint. 2021-12-07 20:58:00 +00:00
fields REST API: Update “object” strings to use the appropriate nouns. 2021-05-25 13:12:58 +00:00
search REST API: Corrections and improvements to docblocks for REST API filters. 2021-01-10 22:23:09 +00:00
class-wp-rest-request.php Code Modernization: Silence the deprecation warnings for missing return type in WP_REST_Request. 2021-08-03 11:08:56 +00:00
class-wp-rest-response.php Docs: Corrections and improvements to inline docs relating to the REST API. 2020-11-16 11:04:12 +00:00
class-wp-rest-server.php Docs: Various corrections and improvements relating to types used in inline documentation. 2021-11-18 13:50:05 +00:00