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
檢視更多 >