Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block library: add PHP since annotations #52820

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/block-library/src/comment-template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 14 additions & 2 deletions packages/block-library/src/footnotes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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 ) {
Expand All @@ -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 ) {
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/pattern/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/post-template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/post-title/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading