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’.


  • 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() )


	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 );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: