register_block_core_post_template

函数
register_block_core_post_template ( No parameters )

register_block_core_post_template: 这个函数用来注册一个新的核心文章模板块。文章模板是为一个文章预定义的布局,可以在多个文章中重复使用。它需要一个设置数组作为参数,以定义该块的行为和外观。

在服务器上注册”core/post-template”块。

function register_block_core_post_template() {
	register_block_type_from_metadata(
		__DIR__ . '/post-template',
		array(
			'render_callback'   => 'render_block_core_post_template',
			'skip_inner_blocks' => true,
		)
	);
}

常见问题

FAQs
查看更多 >