register_block_core_latest_posts

函数
register_block_core_latest_posts ( No parameters )

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

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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function register_block_core_latest_posts() {
register_block_type_from_metadata(
__DIR__ . '/latest-posts',
array(
'render_callback' => 'render_block_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', ) ); }
function register_block_core_latest_posts() {
	register_block_type_from_metadata(
		__DIR__ . '/latest-posts',
		array(
			'render_callback' => 'render_block_core_latest_posts',
		)
	);
}

常见问题

FAQs
查看更多 >