wp_enqueue_editor

函式
wp_enqueue_editor ( No parameters )

wp_enqueue_editor: 這個函式用於排隊等候WordPress塊編輯器所需的指令碼和樣式: 這個函式應該在外掛或主題中使用,以確保在編輯螢幕上載入必要的資產。

輸出編輯器的指令碼、樣式表和預設設定。

編輯器可以在頁面載入後需要時被初始化。關於初始化選項,請參見wp-admin/js/editor.js中的wp.editor.initialize()。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_enqueue_editor() {
if ( ! class_exists( '_WP_Editors', false ) ) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
_WP_Editors::enqueue_default_editor();
}
function wp_enqueue_editor() { if ( ! class_exists( '_WP_Editors', false ) ) { require ABSPATH . WPINC . '/class-wp-editor.php'; } _WP_Editors::enqueue_default_editor(); }
function wp_enqueue_editor() {
	if ( ! class_exists( '_WP_Editors', false ) ) {
		require ABSPATH . WPINC . '/class-wp-editor.php';
	}

	_WP_Editors::enqueue_default_editor();
}

常見問題

FAQs
檢視更多 >