CoreFiles by mySites.guru
query-pagination.php39 lines, 891 bytes, from wordpress-5.9.zip
Raw History Compare with 5.8.19
md5
326bb5cce1dfd12b4fcc1741e253dd62
sha1
0def99f101c3eb0f911976895f21bcaa1af06877
sha256
a545ebcdccb29c82bdbc7ff4c4db77513a23b5a36ef4c8e544ff255170cf66e9
<?php
/**
 * Server-side rendering of the `core/query-pagination` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/query-pagination` block on the server.
 *
 * @param array  $attributes Block attributes.
 * @param string $content    Block default content.
 *
 * @return string Returns the wrapper for the Query pagination.
 */
function render_block_core_query_pagination( $attributes, $content ) {
	if ( empty( trim( $content ) ) ) {
		return '';
	}

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

/**
 * Registers the `core/query-pagination` block on the server.
 */
function register_block_core_query_pagination() {
	register_block_type_from_metadata(
		__DIR__ . '/query-pagination',
		array(
			'render_callback' => 'render_block_core_query_pagination',
		)
	);
}
add_action( 'init', 'register_block_core_query_pagination' );

The same content is in 31 releases, WordPress 5.9-beta1 to 5.9.20. See them all, or every version of this file.