Updates the packages to match Gutenberg version 21.9.0 RC2. Also updates the sync script to work with the new `package-lock.json` format. Some reusable block tests were adjusted to work with more render arguments. Added `core-data` to the ignore list for `verify:source-maps` because Yjs has been bundled by accident. To be removed in a follow-up. See https://core.trac.wordpress.org/ticket/64120. See https://github.com/WordPress/gutenberg/pull/72503. See: https://github.com/WordPress/wordpress-develop/pull/10355. See: https://core.trac.wordpress.org/ticket/64117. Props ellatrix, dmsnell. Fixes #64117. Built from https://develop.svn.wordpress.org/trunk@61009 git-svn-id: http://core.svn.wordpress.org/trunk@60345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Server-side rendering of the `core/comments-pagination` block.
|
|
*
|
|
* @package WordPress
|
|
*/
|
|
|
|
/**
|
|
* Renders the `core/comments-pagination` block on the server.
|
|
*
|
|
* @since 6.0.0
|
|
*
|
|
* @param array $attributes Block attributes.
|
|
* @param string $content Block default content.
|
|
*
|
|
* @return string Returns the wrapper for the Comments pagination.
|
|
*/
|
|
function render_block_core_comments_pagination( $attributes, $content ) {
|
|
if ( empty( trim( $content ) ) ) {
|
|
return '';
|
|
}
|
|
|
|
if ( post_password_required() ) {
|
|
return;
|
|
}
|
|
|
|
$classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : '';
|
|
$wrapper_attributes = get_block_wrapper_attributes(
|
|
array(
|
|
'aria-label' => __( 'Comments pagination' ),
|
|
'class' => $classes,
|
|
)
|
|
);
|
|
|
|
return sprintf(
|
|
'<nav %1$s>%2$s</nav>',
|
|
$wrapper_attributes,
|
|
$content
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Registers the `core/comments-pagination` block on the server.
|
|
*
|
|
* @since 6.0.0
|
|
*/
|
|
function register_block_core_comments_pagination() {
|
|
register_block_type_from_metadata(
|
|
__DIR__ . '/comments-pagination',
|
|
array(
|
|
'render_callback' => 'render_block_core_comments_pagination',
|
|
)
|
|
);
|
|
}
|
|
add_action( 'init', 'register_block_core_comments_pagination' );
|