wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



gutenberg_register_legacy_query_loop_block › WordPress Function

Seitn/v
Veraltetn/v
gutenberg_register_legacy_query_loop_block ( Keine Parameter )
Siehe:
Definiert in:
Codex:

Complements the renaming of `Query Loop` to `Post Template`.

This ensures backwards compatibility for any users running the Gutenberg plugin who have used Query Loop prior to its renaming. This can be removed when WordPress 5.9 is released.


Quellcode

function gutenberg_register_legacy_query_loop_block() {
	$registry = WP_Block_Type_Registry::get_instance();
	if ( $registry->is_registered( 'core/query-loop' ) ) {
		unregister_block_type( 'core/query-loop' );
	}
	register_block_type(
		'core/query-loop',
		array(
			'category'          => 'design',
			'uses_context'      => array(
				'queryId',
				'query',
				'queryContext',
				'displayLayout',
				'templateSlug',
			),
			'supports'          => array(
				'reusable' => false,
				'html'     => false,
				'align'    => true,
			),
			'style'             => 'wp-block-post-template',
			'render_callback'   => 'render_legacy_query_loop_block',
			'skip_inner_blocks' => true,
		)
	);
}