register_block_core_latest_posts

函数
register_block_core_latest_posts ( No parameters )

register_block_core_latest_posts: 这个函数用来为Gutenberg编辑器注册”最新文章”块。该区块显示网站上的最新文章。

在服务器上注册”core/latest-posts”块。

function register_block_core_latest_posts() {
	register_block_type_from_metadata(
		__DIR__ . '/latest-posts',
		array(
			'render_callback' => 'render_block_core_latest_posts',
		)
	);
}

常见问题

FAQs
查看更多 >