From 51774efbba2d334b04683842533e4fef1777b70b Mon Sep 17 00:00:00 2001 From: Ramon Date: Fri, 21 Jul 2023 19:05:44 +1000 Subject: [PATCH] Adding @since annotation for relevant 6.3 changes. (#52820) --- .../block-library/src/comment-template/index.php | 2 ++ packages/block-library/src/footnotes/index.php | 16 ++++++++++++++-- packages/block-library/src/pattern/index.php | 2 ++ .../block-library/src/post-template/index.php | 2 ++ packages/block-library/src/post-title/index.php | 2 ++ packages/block-library/src/search/index.php | 2 ++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/comment-template/index.php b/packages/block-library/src/comment-template/index.php index bb1cfa474e4c36..5a0eef5685cf1c 100644 --- a/packages/block-library/src/comment-template/index.php +++ b/packages/block-library/src/comment-template/index.php @@ -8,6 +8,8 @@ /** * Function that recursively renders a list of nested comments. * + * @since 6.3.0 Changed render_block_context priority to `1`. + * * @global int $comment_depth * * @param WP_Comment[] $comments The array of comments. diff --git a/packages/block-library/src/footnotes/index.php b/packages/block-library/src/footnotes/index.php index d28161d6acdae4..ca9aca60abfb67 100644 --- a/packages/block-library/src/footnotes/index.php +++ b/packages/block-library/src/footnotes/index.php @@ -8,6 +8,8 @@ /** * Renders the `core/footnotes` block on the server. * + * @since 6.3.0 + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. @@ -57,6 +59,8 @@ function render_block_core_footnotes( $attributes, $content, $block ) { /** * Registers the `core/footnotes` block on the server. + * + * @since 6.3.0 */ function register_block_core_footnotes() { foreach ( array( 'post', 'page' ) as $post_type ) { @@ -84,6 +88,8 @@ function register_block_core_footnotes() { /** * Saves the footnotes meta value to the revision. * + * @since 6.3.0 + * * @param int $revision_id The revision ID. */ static function( $revision_id ) { @@ -127,6 +133,8 @@ static function( $revision_id ) { * available at the time, so we have to add it afterwards through the * `"rest_after_insert_{$post_type}"` action. * + * @since 6.3.0 + * * @param WP_Post $post The post object. */ static function( $post ) { @@ -155,6 +163,8 @@ static function( $post ) { /** * Restores the footnotes meta value from the revision. * + * @since 6.3.0 + * * @param int $post_id The post ID. * @param int $revision_id The revision ID. */ @@ -176,8 +186,9 @@ static function( $post_id, $revision_id ) { /** * Adds the footnotes field to the revision. * - * @param array $fields The revision fields. + * @since 6.3.0 * + * @param array $fields The revision fields. * @return array The revision fields. */ static function( $fields ) { @@ -191,11 +202,12 @@ static function( $fields ) { /** * Gets the footnotes field from the revision. * + * @since 6.3.0 + * * @param string $revision_field The field value, but $revision->$field * (footnotes) does not exist. * @param string $field The field name, in this case "footnotes". * @param object $revision The revision object to compare against. - * * @return string The field value. */ static function( $revision_field, $field, $revision ) { diff --git a/packages/block-library/src/pattern/index.php b/packages/block-library/src/pattern/index.php index a819cb6bd4cdfd..6368bdb7b74875 100644 --- a/packages/block-library/src/pattern/index.php +++ b/packages/block-library/src/pattern/index.php @@ -22,6 +22,8 @@ function register_block_core_pattern() { /** * Renders the `core/pattern` block on the server. * + * @since 6.3.0 Backwards compatibility: blocks with no `syncStatus` attribute do not receive block wrapper. + * * @param array $attributes Block attributes. * * @return string Returns the output of the pattern. diff --git a/packages/block-library/src/post-template/index.php b/packages/block-library/src/post-template/index.php index b1499d845f39a6..88b7c27f1c66f9 100644 --- a/packages/block-library/src/post-template/index.php +++ b/packages/block-library/src/post-template/index.php @@ -34,6 +34,8 @@ function block_core_post_template_uses_featured_image( $inner_blocks ) { /** * Renders the `core/post-template` block on the server. * + * @since 6.3.0 Changed render_block_context priority to `1`. + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. diff --git a/packages/block-library/src/post-title/index.php b/packages/block-library/src/post-title/index.php index 1769b199cebf17..8b0e431b3a8be4 100644 --- a/packages/block-library/src/post-title/index.php +++ b/packages/block-library/src/post-title/index.php @@ -8,6 +8,8 @@ /** * Renders the `core/post-title` block on the server. * + * @since 6.3.0 Omitting the $post argument from the `get_the_title`. + * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. diff --git a/packages/block-library/src/search/index.php b/packages/block-library/src/search/index.php index 700a299a92457a..b0fed54d2f385a 100644 --- a/packages/block-library/src/search/index.php +++ b/packages/block-library/src/search/index.php @@ -8,6 +8,8 @@ /** * Dynamically renders the `core/search` block. * + * @since 6.3.0 Using block.json `viewScript` to register script, and update `view_script_handles()` only when needed. + * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block.