apply_filters( ‘mce_css’, string $stylesheets )

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


Comma-delimited list of stylesheets.

More Information

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


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



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., ‘,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 = ',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.