Definition:
function add_editor_style( $stylesheet = 'editor-style.css' ) {}
Add callback for custom TinyMCE editor stylesheets.
The parameter $stylesheet is the name of the stylesheet, relative to the theme root. It also accepts an array of stylesheets. It is optional and defaults to ‘editor-style.css’.
Parameters
- mixed $stylesheet: Optional. Stylesheet name or array thereof, relative to theme root. Defaults to ‘editor-style.css’
Source code
function add_editor_style( $stylesheet = 'editor-style.css' ) { add_theme_support( 'editor-style' ); if ( ! is_admin() ) return; global $editor_styles; $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 ); }
229
No comments yet... Be the first to leave a reply!