函数原型
add_editor_style( array|string $stylesheet = ‘editor-style.css’ )
函数描述
Adds callback for custom TinyMCE editor stylesheets.
是否弃用
未弃用
函数参数
-
$stylesheet
array|string
Optional - Stylesheet name or array thereof, relative to theme root.
Defaults to'editor-style.css'Default:
'editor-style.css'
函数返回值
无
函数位置
File: wp-includes/theme.php.
函数源码
function add_editor_style( $stylesheet = 'editor-style.css' ) {
global $editor_styles;
add_theme_support( 'editor-style' );
$editor_styles = (array) $editor_styles;
$stylesheet = (array) $stylesheet;
if ( is_rtl() ) {
$rtl_stylesheet = str_replace( '.css', '-rtl.css', $stylesheet[0] );
$stylesheet[] = $rtl_stylesheet;
}
$editor_styles = array_merge( $editor_styles, $stylesheet );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

