Press This: properly add Open Sans to the editor, using the mce_css
filter.
See #26072. Fixes #33189. git-svn-id: https://develop.svn.wordpress.org/trunk@33497 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
05c32013d7
commit
f0935052c2
@ -6,7 +6,6 @@ Press This TinyMCE editor styles :)
|
||||
/**
|
||||
* Links
|
||||
*/
|
||||
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,600,700");
|
||||
a {
|
||||
color: #0073aa;
|
||||
}
|
||||
|
@ -783,7 +783,36 @@ class WP_Press_This {
|
||||
$press_this = str_replace( '.css', '-rtl.css', $press_this );
|
||||
}
|
||||
|
||||
return $styles . $press_this;
|
||||
$open_sans_font_url = '';
|
||||
|
||||
/* translators: If there are characters in your language that are not supported
|
||||
* by Open Sans, translate this to 'off'. Do not translate into your own language.
|
||||
*/
|
||||
if ( 'off' !== _x( 'on', 'Open Sans font: on or off' ) ) {
|
||||
$subsets = 'latin,latin-ext';
|
||||
|
||||
/* translators: To add an additional Open Sans character subset specific to your language,
|
||||
* translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
|
||||
*/
|
||||
$subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' );
|
||||
|
||||
if ( 'cyrillic' == $subset ) {
|
||||
$subsets .= ',cyrillic,cyrillic-ext';
|
||||
} elseif ( 'greek' == $subset ) {
|
||||
$subsets .= ',greek,greek-ext';
|
||||
} elseif ( 'vietnamese' == $subset ) {
|
||||
$subsets .= ',vietnamese';
|
||||
}
|
||||
|
||||
$query_args = array(
|
||||
'family' => urlencode( 'Open Sans:400italic,700italic,400,600,700' ),
|
||||
'subset' => urlencode( $subsets ),
|
||||
);
|
||||
|
||||
$open_sans_font_url = ',' . add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
|
||||
}
|
||||
|
||||
return $styles . $press_this . $open_sans_font_url;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user