register_block_core_shortcode

函式
register_block_core_shortcode ( No parameters )

register_block_core_shortcode: 這個函式在編輯器中註冊了一個短碼塊型別,其設定包括標題、描述、類別、圖示和關鍵詞等。短碼塊允許使用者在文章或頁面內容中新增自定義短碼。

在伺服器上註冊`core/shortcode`區塊。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function register_block_core_shortcode() {
register_block_type_from_metadata(
__DIR__ . '/shortcode',
array(
'render_callback' => 'render_block_core_shortcode',
)
);
}
function register_block_core_shortcode() { register_block_type_from_metadata( __DIR__ . '/shortcode', array( 'render_callback' => 'render_block_core_shortcode', ) ); }
function register_block_core_shortcode() {
	register_block_type_from_metadata(
		__DIR__ . '/shortcode',
		array(
			'render_callback' => 'render_block_core_shortcode',
		)
	);
}

常見問題

FAQs
檢視更多 >