Skip to content

Commit

Permalink
Update @wordpress packages for 6.3 RC2
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Jul 25, 2023
1 parent a176f19 commit 84f2b13
Show file tree
Hide file tree
Showing 9 changed files with 378 additions and 230 deletions.
428 changes: 214 additions & 214 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,30 @@
"@wordpress/api-fetch": "6.32.1",
"@wordpress/autop": "3.35.1",
"@wordpress/blob": "3.35.1",
"@wordpress/block-directory": "4.12.10",
"@wordpress/block-editor": "12.3.8",
"@wordpress/block-library": "8.12.10",
"@wordpress/block-directory": "4.12.11",
"@wordpress/block-editor": "12.3.9",
"@wordpress/block-library": "8.12.11",
"@wordpress/block-serialization-default-parser": "4.35.1",
"@wordpress/blocks": "12.12.4",
"@wordpress/blocks": "12.12.5",
"@wordpress/commands": "0.6.8",
"@wordpress/components": "25.1.8",
"@wordpress/compose": "6.12.1",
"@wordpress/core-commands": "0.4.8",
"@wordpress/core-data": "6.12.8",
"@wordpress/customize-widgets": "4.12.10",
"@wordpress/core-commands": "0.4.9",
"@wordpress/core-data": "6.12.9",
"@wordpress/customize-widgets": "4.12.11",
"@wordpress/data": "9.5.4",
"@wordpress/data-controls": "3.4.4",
"@wordpress/date": "4.35.1",
"@wordpress/deprecated": "3.35.1",
"@wordpress/dom": "3.35.1",
"@wordpress/dom-ready": "3.35.1",
"@wordpress/edit-post": "7.12.10",
"@wordpress/edit-site": "5.12.10",
"@wordpress/edit-widgets": "5.12.10",
"@wordpress/editor": "13.12.8",
"@wordpress/edit-post": "7.12.11",
"@wordpress/edit-site": "5.12.11",
"@wordpress/edit-widgets": "5.12.11",
"@wordpress/editor": "13.12.9",
"@wordpress/element": "5.12.1",
"@wordpress/escape-html": "2.35.1",
"@wordpress/format-library": "4.12.8",
"@wordpress/format-library": "4.12.9",
"@wordpress/hooks": "3.35.1",
"@wordpress/html-entities": "3.35.1",
"@wordpress/i18n": "4.35.1",
Expand All @@ -126,17 +126,17 @@
"@wordpress/priority-queue": "2.35.1",
"@wordpress/private-apis": "0.17.2",
"@wordpress/redux-routine": "4.35.1",
"@wordpress/reusable-blocks": "4.12.8",
"@wordpress/reusable-blocks": "4.12.9",
"@wordpress/rich-text": "6.12.5",
"@wordpress/router": "0.4.2",
"@wordpress/server-side-render": "4.12.8",
"@wordpress/server-side-render": "4.12.9",
"@wordpress/shortcode": "3.35.1",
"@wordpress/style-engine": "1.18.1",
"@wordpress/token-list": "2.35.1",
"@wordpress/url": "3.36.1",
"@wordpress/viewport": "5.12.4",
"@wordpress/warning": "2.35.1",
"@wordpress/widgets": "3.12.8",
"@wordpress/widgets": "3.12.9",
"@wordpress/wordcount": "3.35.1",
"backbone": "1.4.1",
"clipboard": "2.0.11",
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/assets/script-loader-packages.min.php

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/wp-includes/blocks/comment-template.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
138 changes: 138 additions & 0 deletions src/wp-includes/blocks/footnotes.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 All @@ -78,3 +82,137 @@ function register_block_core_footnotes() {
);
}
add_action( 'init', 'register_block_core_footnotes' );

add_action(
'wp_after_insert_post',
/**
* Saves the footnotes meta value to the revision.
*
* @since 6.3.0
*
* @param int $revision_id The revision ID.
*/
static function( $revision_id ) {
$post_id = wp_is_post_revision( $revision_id );

if ( $post_id ) {
$footnotes = get_post_meta( $post_id, 'footnotes', true );

if ( $footnotes ) {
// Can't use update_post_meta() because it doesn't allow revisions.
update_metadata( 'post', $revision_id, 'footnotes', $footnotes );
}
}
}
);

add_action(
'_wp_put_post_revision',
/**
* Keeps track of the revision ID for "rest_after_insert_{$post_type}".
*
* @param int $revision_id The revision ID.
*/
static function( $revision_id ) {
global $_gutenberg_revision_id;
$_gutenberg_revision_id = $revision_id;
}
);

foreach ( array( 'post', 'page' ) as $post_type ) {
add_action(
"rest_after_insert_{$post_type}",
/**
* This is a specific fix for the REST API. The REST API doesn't update
* the post and post meta in one go (through `meta_input`). While it
* does fix the `wp_after_insert_post` hook to be called correctly after
* updating meta, it does NOT fix hooks such as post_updated and
* save_post, which are normally also fired after post meta is updated
* in `wp_insert_post()`. Unfortunately, `wp_save_post_revision` is
* added to the `post_updated` action, which means the meta is not
* 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 ) {
global $_gutenberg_revision_id;

if ( $_gutenberg_revision_id ) {
$revision = get_post( $_gutenberg_revision_id );
$post_id = $revision->post_parent;

// Just making sure we're updating the right revision.
if ( $post->ID === $post_id ) {
$footnotes = get_post_meta( $post_id, 'footnotes', true );

if ( $footnotes ) {
// Can't use update_post_meta() because it doesn't allow revisions.
update_metadata( 'post', $_gutenberg_revision_id, 'footnotes', $footnotes );
}
}
}
}
);
}

add_action(
'wp_restore_post_revision',
/**
* 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.
*/
static function( $post_id, $revision_id ) {
$footnotes = get_post_meta( $revision_id, 'footnotes', true );

if ( $footnotes ) {
update_post_meta( $post_id, 'footnotes', $footnotes );
} else {
delete_post_meta( $post_id, 'footnotes' );
}
},
10,
2
);

add_filter(
'_wp_post_revision_fields',
/**
* Adds the footnotes field to the revision.
*
* @since 6.3.0
*
* @param array $fields The revision fields.
* @return array The revision fields.
*/
static function( $fields ) {
$fields['footnotes'] = __( 'Footnotes' );
return $fields;
}
);

add_filter(
'wp_post_revision_field_footnotes',
/**
* 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 ) {
return get_metadata( 'post', $revision->ID, $field, true );
},
10,
3
);
2 changes: 2 additions & 0 deletions src/wp-includes/blocks/pattern.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 src/wp-includes/blocks/post-template.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 src/wp-includes/blocks/post-title.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 src/wp-includes/blocks/search.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

0 comments on commit 84f2b13

Please sign in to comment.