remove_editor_styles

函式
remove_editor_styles ( No parameters )
返回值
  • (bool) True on success, false if there were no stylesheets to remove.
定義位置
相關方法
add_editor_styleget_editor_stylesheetsremove_roleget_block_editor_theme_stylesprint_emoji_styles
引入
3.1.0
棄用
-

remove_editor_styles: 這個函式用來刪除WordPress中的編輯器樣式。編輯器樣式是用來定製WordPress中編輯器的外觀的: 這個函式不需要引數。

移除所有視覺化編輯器的樣式表。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function remove_editor_styles() {
if ( ! current_theme_supports( 'editor-style' ) ) {
return false;
}
_remove_theme_support( 'editor-style' );
if ( is_admin() ) {
$GLOBALS['editor_styles'] = array();
}
return true;
}
function remove_editor_styles() { if ( ! current_theme_supports( 'editor-style' ) ) { return false; } _remove_theme_support( 'editor-style' ); if ( is_admin() ) { $GLOBALS['editor_styles'] = array(); } return true; }
function remove_editor_styles() {
	if ( ! current_theme_supports( 'editor-style' ) ) {
		return false;
	}
	_remove_theme_support( 'editor-style' );
	if ( is_admin() ) {
		$GLOBALS['editor_styles'] = array();
	}
	return true;
}

常見問題

FAQs
檢視更多 >