wpseek.com
A WordPress-centric search engine for devs and theme authors



render_legacy_query_loop_block › WordPress Function

Sincen/a
Deprecatedn/a
render_legacy_query_loop_block ( $attributes, $content, $block )
Parameters: (3)
  • (array) $attributes Block attributes.
    Required: Yes
  • (string) $content Block default content.
    Required: Yes
  • (WP_Block) $block Block instance.
    Required: Yes
Returns:
  • (string) Returns the output of the query, structured using the layout defined by the block's inner blocks.
Defined at:
Codex:

Renders the legacy `core/query-loop` block on the server.

It triggers a developer warning and then calls the renamed block's render_callback function output. This can be removed when WordPress 5.9 is released.


Source

function render_legacy_query_loop_block( $attributes, $content, $block ) {
	trigger_error(
		/* translators: %1$s: Block type */
		sprintf( __( 'Block %1$s has been renamed to Post Template. %1$s will be supported until WordPress version 5.9.', 'gutenberg' ), $block->name ),
		headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
	);
	return render_block_core_post_template( $attributes, $content, $block );
}