Advertisements

add_editor_style

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

Advertisements

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:

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

%d bloggers like this: