Changeset 57040
- Timestamp:
- 11/01/2023 11:18:52 AM (12 months ago)
- Location:
- branches/6.4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.4
- Property svn:mergeinfo changed
/trunk merged: 57032-57033
- Property svn:mergeinfo changed
-
branches/6.4/src/wp-includes/blocks.php
r57039 r57040 654 654 * This test optimizes for performance rather than strict accuracy, detecting 655 655 * whether the block type exists but not validating its structure and not checking 656 * reusable blocks. For strict accuracy, you should use the block parser on post content. 656 * synced patterns (formerly called reusable blocks). For strict accuracy, 657 * you should use the block parser on post content. 657 658 * 658 659 * @since 5.0.0 -
branches/6.4/src/wp-includes/rest-api/endpoints/class-wp-rest-blocks-controller.php
r56547 r57040 1 1 <?php 2 2 /** 3 * Reusable blocks REST API: WP_REST_Blocks_Controller class3 * Synced patterns REST API: WP_REST_Blocks_Controller class 4 4 * 5 5 * @package WordPress … … 10 10 /** 11 11 * Controller which provides a REST endpoint for the editor to read, create, 12 * edit and delete reusable blocks. Blocks are stored as posts with the wp_block13 * post type.12 * edit, and delete synced patterns (formerly called reusable blocks). 13 * Patterns are stored as posts with the wp_block post type. 14 14 * 15 15 * @since 5.0.0 … … 21 21 22 22 /** 23 * Checks if a blockcan be read.23 * Checks if a pattern can be read. 24 24 * 25 25 * @since 5.0.0 26 26 * 27 27 * @param WP_Post $post Post object that backs the block. 28 * @return bool Whether the blockcan be read.28 * @return bool Whether the pattern can be read. 29 29 */ 30 30 public function check_read_permission( $post ) { … … 51 51 52 52 /* 53 * Remove `title.rendered` and `content.rendered` from the response. It54 * doesn't make sense for a reusable block to have rendered content on its55 * own,since rendering a block requires it to be inside a post or a page.53 * Remove `title.rendered` and `content.rendered` from the response. 54 * It doesn't make sense for a pattern to have rendered content on its own, 55 * since rendering a block requires it to be inside a post or a page. 56 56 */ 57 57 unset( $data['title']['rendered'] ); … … 65 65 66 66 /** 67 * Retrieves the block's schema, conforming to JSON Schema.67 * Retrieves the pattern's schema, conforming to JSON Schema. 68 68 * 69 69 * @since 5.0.0 … … 79 79 80 80 /* 81 * Allow all contexts to access `title.raw` and `content.raw`. Clients always82 * need the raw markup of a reusable block to do anything useful, e.g. parse83 * it or display it in an editor.81 * Allow all contexts to access `title.raw` and `content.raw`. 82 * Clients always need the raw markup of a pattern to do anything useful, 83 * e.g. parse it or display it in an editor. 84 84 */ 85 85 $schema['properties']['title']['properties']['raw']['context'] = array( 'view', 'edit' ); … … 87 87 88 88 /* 89 * Remove `title.rendered` and `content.rendered` from the schema. It doesn’t90 * make sense for a reusable block to have rendered content on its own, since91 * rendering a block requires it to be inside a post or a page.89 * Remove `title.rendered` and `content.rendered` from the schema. 90 * It doesn't make sense for a pattern to have rendered content on its own, 91 * since rendering a block requires it to be inside a post or a page. 92 92 */ 93 93 unset( $schema['properties']['title']['properties']['rendered'] ); -
branches/6.4/tests/phpunit/tests/blocks/renderReusable.php
r55457 r57040 1 1 <?php 2 2 /** 3 * Tests for reusable blockrendering.3 * Tests for synced pattern rendering. 4 4 * 5 5 * @package WordPress … … 84 84 85 85 /** 86 * Make sure that a reusable blockcan be rendered twice in a row.86 * Make sure that a synced pattern can be rendered twice in a row. 87 87 * 88 88 * @ticket 52364 -
branches/6.4/tests/phpunit/tests/rest-api/rest-blocks-controller.php
r56160 r57040 99 99 /** 100 100 * Exhaustively check that each role either can or cannot create, edit, 101 * update, and delete reusable blocks.101 * update, and delete synced patterns. 102 102 * 103 103 * @ticket 45098
Note: See TracChangeset
for help on using the changeset viewer.