CoreFiles by mySites.guru
comments-pagination.php43 lines, 967 bytes, from wordpress-6.1.13.zip
Raw History Compare with 6.1.12
md5
d70d79225baf4af14b50a398cb0c5299
sha1
4ea85fb24e6b99a0b1aef76c87b8b7087730b817
sha256
928437275fc785992bf2808eba89b8699dd4d22547a7603efc6579a4abb69b4a
<?php
/**
 * Server-side rendering of the `core/comments-pagination` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/comments-pagination` block on the server.
 *
 * @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;
	}

	return sprintf(
		'<div %1$s>%2$s</div>',
		get_block_wrapper_attributes(),
		$content
	);
}

/**
 * Registers the `core/comments-pagination` block on the server.
 */
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' );

The same content is in 52 releases, WordPress 6.0-RC1 to 6.1.16. See them all, or every version of this file.