apply_filters( ‘mce_css’, string $stylesheets )

Filters the comma-delimited list of stylesheets to load in TinyMCE.

Parameters

$stylesheetsstring
Comma-delimited list of stylesheets.

More Information

If you are doing this from within a theme, consider using add_editor_style() instead.

Source

$mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' );

Changelog

VersionDescription
2.1.0Introduced.

User Contributed Notes

  1. Skip to note 4 content

    Example Migrated from Codex:

    Add a Google Fonts CSS stylesheet.

    Because mce_css is a comma-separated string of values, you cannot use the default href string from a source like Google Fonts if it contains multiple faces (e.g., ‘http://fonts.googleapis.com/css?family=Lato:300,400,700’). You must replace the commas with their URL-encoded equivalent, ‘%2C’.

    add_filter( 'mce_css', 'plugin_mce_css' );
    
    function plugin_mce_css( $mce_css ) {
    	if ( ! empty( $mce_css ) )
    		$mce_css .= ',';
    
    	$font_url = 'http://fonts.googleapis.com/css?family=Lato:300,400,700';
    	$mce_css .= str_replace( ',', '%2C', $font_url );
    
    	return $mce_css;
    }

You must log in before being able to contribute a note or feedback.