Commit Graph

11 Commits

Author SHA1 Message Date
Sergey Biryukov
9a49b70239 Coding Standards: Remove superfluous blank lines at the end of various classes.
Note: This is enforced by WPCS 3.0.0.

Follow-up to [56536].

Props jrf.
See #59161, #58831.
Built from https://develop.svn.wordpress.org/trunk@56547


git-svn-id: http://core.svn.wordpress.org/trunk@56059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-08 09:32:23 +00:00
K. Adam White
96cd4c4224 REST API: Remove misleading comment in WP_REST_Blocks_Controller->get_item_schema.
In r56093 schema caching was added above a comment instructing developers not to cache that controller's schema. However, there is no obvious penalty for re-caching schema that is partially derived from a parent.

Caching schema in the same way in every controller is beneficial consistency, and discussion at WCUS2023 contributor day concluded we could remove this comment.

Props ahardyjpl, davidbinda, johnjamesjacoby, TimothyBlynJacobs.

Fixes #59193. See #58657.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-08-24 20:23:16 +00:00
isabel_brison
4e70f57a0b Editor: fix since annotation in rest blocks controller class.
Changes `6.3` to `6.3.0` in the since annotation for the `filter_response_by_context` function.

Props swissspidy, peterwilsoncc, mukesh27.
Fixes #58677.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-07-12 04:27:27 +00:00
isabel_brison
ab8c2bd924 Editor: rename sync_status and move it to top level.
Renames sync_status to wp_pattern_sync_status and moves it to top level field of wp_block post type.

Props glendaviesnz, aaronrobertshaw, mukesh27, peterwilsoncc.
Fixes 58677.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-07-07 07:29:23 +00:00
K. Adam White
d72667d737 REST API: Cache schema in block pattern and menu item endpoints.
Performance improvement to add schema caching to pattern and menu item REST endpoints, so identical schema object are not needlessly regenerated.

Props spacedmonkey.
Fixes #58657. See [45811].


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


git-svn-id: http://core.svn.wordpress.org/trunk@55605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-28 15:53:26 +00:00
audrasjb
8669c16e04 Docs: Miscellaneous docblock corrections in REST API and Sitemaps API.
Props kebbet.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-15 21:22:02 +00:00
Dominik Schilling
ed71319421 Role/Capability: Use meta caps edit_post, read_post, and delete_post directly.
Rather than consulting the post type object, let `map_meta_cap()` handle that for us.

Props peterwilsoncc, ocean90.
Fixes #50128.
See #23226.
Built from https://develop.svn.wordpress.org/trunk@47850


git-svn-id: http://core.svn.wordpress.org/trunk@47626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-23 15:24:07 +00:00
John Blackbourn
f93ee2ca76 Docs: Increase the specificity of various docblock parameter types and return types.
See #48303
Built from https://develop.svn.wordpress.org/trunk@46823


git-svn-id: http://core.svn.wordpress.org/trunk@46623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-06 22:43:04 +00:00
K. Adam White
5dbb64d0dd REST API: Cache results of get_item_schema on controller instances for performance.
Caches the output of get_item_schema() to avoid redundant recomputation of translatable strings and other computed values. This method is called many times per item in each REST request, and the results of the method should not vary between calls.
Additional schema fields are not cached.

Props kadamwhite, joehoyle, TimothyBlynJacobs.
Fixes #47871.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-15 21:09:55 +00:00
desrosj
f2b97f3c7f REST API: Always include title.raw/content.raw for Blocks in context=view.
Demarcations for reusable blocks are always expected to be accessible by clients.

Props noisysocks, youknowriad.

Merges [43917] to trunk.

See #45145 for the patch, #45098 for the original ticket.
Built from https://develop.svn.wordpress.org/trunk@44268


git-svn-id: http://core.svn.wordpress.org/trunk@44098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 17:22:52 +00:00
Jeremy Felt
c3e927d2c8 REST API: Add endpoints for blocks.
`WP_REST_Block_Renderer_Controller` allows rendering of server-side rendered blocks, whilst `WP_REST_Blocks_Controller` allows retrieving of reusable blocks.

Merges [43805] and [43806] from the 5.0 branch to trunk.

Props desrosj, danielbachhuber, pento, Presskopp, swissspidy.
See #45065, #45098.

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


git-svn-id: http://core.svn.wordpress.org/trunk@43980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 02:35:38 +00:00