register_block_core_shortcode

函数
register_block_core_shortcode ( No parameters )

register_block_core_shortcode: 这个函数在编辑器中注册了一个短码块类型,其设置包括标题、描述、类别、图标和关键词等。短码块允许用户在文章或页面内容中添加自定义短码。

在服务器上注册`core/shortcode`区块。

function register_block_core_shortcode() {
	register_block_type_from_metadata(
		__DIR__ . '/shortcode',
		array(
			'render_callback' => 'render_block_core_shortcode',
		)
	);
}

常见问题

FAQs
查看更多 >