rusly
rusly

Reputation: 1522

how to include absolute css path using add_editor_style() in wordpress

How to include external css like google font http://fonts.googleapis.com/css?family=Lato using add_editor_style() ?

when i add add_editor_style('http://fonts.googleapis.com/css?family=Lato');, in source code will show like this :

<link rel="stylesheet" data-mce-href="http://203.223.152.159/~marineac/wp-content/themes/twentyten/http://fonts.googleapis.com/css?family=Lato&amp;ver=342-201106301" href="http://203.223.152.159/~marineac/wp-content/themes/twentyten/http://fonts.googleapis.com/css?family=Lato&amp;ver=342-201106301">

Upvotes: 0

Views: 442

Answers (2)

lkraav
lkraav

Reputation: 2827

This was patched in changeset 24735 which I believe is part of 3.6 or 3.6.1.

Upvotes: 1

RRikesh
RRikesh

Reputation: 14411

You should use the mce_css filter. Not tested:

function so_17961871( $mce_css ) {
    if ( ! empty( $mce_css ) )
        $mce_css .= ',';
    $mce_css .= 'http://fonts.googleapis.com/css?family=Lato';

    return $mce_css;
}

add_filter( 'mce_css', 'so_17961871' );

Upvotes: 1

Related Questions