Skip to content

Commit

Permalink
Editor: mention reusable block rename to pattern(s) in each doc
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminknox committed Sep 23, 2023
1 parent 32ba91e commit 57762ed
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</div>
<div class="column is-vertically-aligned-center">
<h3><?php _e( 'Do everything in the Site Editor' ); ?></h3>
<p><?php _e( 'WordPress 6.3 brings your content, templates, and patterns together in the Site Editor for the first time. Add pages, browse style variations, create synced patterns, and enjoy fine-tuned control over your navigation menus. No more time wasted switching across different site areas—now you can focus on what matters most. Creation to completion, all in one place.' ); ?></p>
<p><?php _e( 'WordPress 6.3 brings your content, templates, and patterns together in the Site Editor for the first time. Add pages, browse style variations, create synced patterns (previously referred to as “reusable blocks”), and enjoy fine-tuned control over your navigation menus. No more time wasted switching across different site areas—now you can focus on what matters most. Creation to completion, all in one place.' ); ?></p>
</div>
</div>

Expand Down
4 changes: 3 additions & 1 deletion src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,11 @@ function has_blocks( $post = null ) {
*
* This test optimizes for performance rather than strict accuracy, detecting
* whether the block type exists but not validating its structure and not checking
* reusable blocks. For strict accuracy, you should use the block parser on post content.
* patterns (previously referred to as reusable blocks). For strict accuracy, you
* should use the block parser on post content.
*
* @since 5.0.0
* @since 6.3.0 Reusable Blocks renamed to Patterns.
*
* @see parse_blocks()
*
Expand Down
2 changes: 2 additions & 0 deletions src/wp-includes/blocks/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/**
* Renders the `core/block` block on server.
*
* @since 6.3.0 Reusable Blocks renamed to Patterns.
*
* @param array $attributes The block attributes.
*
* @return string Rendered HTML of the referenced block.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@

/**
* Controller which provides a REST endpoint for the editor to read, create,
* edit and delete reusable blocks. Blocks are stored as posts with the wp_block
* post type.
* edit and delete patterns (previously referred to as reusable blocks). Patterns are
* stored as posts with the wp_block post type.
*
* @since 5.0.0
* @since 6.3.0 Reusable Blocks renamed to Patterns.
*
* @see WP_REST_Posts_Controller
* @see WP_REST_Controller
*/
class WP_REST_Blocks_Controller extends WP_REST_Posts_Controller {

/**
* Checks if a block can be read.
* Checks if a pattern (previously referred to as reusable block) can be read.
*
* @since 5.0.0
* @since 6.3.0 Reusable Blocks renamed to Patterns.
*
* @param WP_Post $post Post object that backs the block.
* @return bool Whether the block can be read.
* @return bool Whether the pattern (previously referred to as reusable block) can be read.
*/
public function check_read_permission( $post ) {
// By default the read_post capability is mapped to edit_posts.
Expand All @@ -41,6 +43,7 @@ public function check_read_permission( $post ) {
*
* @since 5.0.0
* @since 6.3.0 Adds the `wp_pattern_sync_status` postmeta property to the top level of response.
* @since 6.3.0 Reusable Blocks renamed to Patterns.

Check failure on line 46 in src/wp-includes/rest-api/endpoints/class-wp-rest-blocks-controller.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
*
* @param array $data Response data to filter.
* @param string $context Context defined in the schema.
Expand All @@ -64,9 +67,11 @@ public function filter_response_by_context( $data, $context ) {
}

/**
* Retrieves the block's schema, conforming to JSON Schema.
* Retrieves the patterns (previously referred to as reusable blocks) schema, conforming
* to JSON Schema.
*
* @since 5.0.0
* @since 6.3.0 Reusable Blocks renamed to Patterns.
*
* @return array Item schema data.
*/
Expand Down
4 changes: 3 additions & 1 deletion tests/phpunit/tests/rest-api/rest-blocks-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ public function data_capabilities() {

/**
* Exhaustively check that each role either can or cannot create, edit,
* update, and delete reusable blocks.
* update, and delete patterns (previously referred to as reusable blocks).
*
* @ticket 45098
*
* @dataProvider data_capabilities
*
* @since 6.3.0 Reusable Blocks renamed to Patterns.
*
* @param string $action Action to perform in the test.
* @param string $role User role to test.
* @param int $expected_status Expected HTTP response status.
Expand Down

0 comments on commit 57762ed

Please sign in to comment.