register_block_core_post_template

函数
register_block_core_post_template ( No parameters )

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

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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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,
)
);
}
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, ) ); }
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
查看更多 >