WordPress.org

Make WordPress Core

Changeset 33497


Ignore:
Timestamp:
07/29/2015 07:37:06 PM (6 years ago)
Author:
azaozz
Message:

Press This: properly add Open Sans to the editor, using the mce_css filter.
See #26072. Fixes #33189.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/press-this-editor.css

    r32843 r33497  
    77* Links
    88*/
    9 @import url("https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,600,700");
    109a {
    1110    color: #0073aa;
  • trunk/src/wp-admin/includes/class-wp-press-this.php

    r33128 r33497  
    784784        }
    785785
    786         return $styles . $press_this;
     786        $open_sans_font_url = '';
     787
     788        /* translators: If there are characters in your language that are not supported
     789         * by Open Sans, translate this to 'off'. Do not translate into your own language.
     790         */
     791        if ( 'off' !== _x( 'on', 'Open Sans font: on or off' ) ) {
     792            $subsets = 'latin,latin-ext';
     793
     794            /* translators: To add an additional Open Sans character subset specific to your language,
     795             * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
     796             */
     797            $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' );
     798
     799            if ( 'cyrillic' == $subset ) {
     800                $subsets .= ',cyrillic,cyrillic-ext';
     801            } elseif ( 'greek' == $subset ) {
     802                $subsets .= ',greek,greek-ext';
     803            } elseif ( 'vietnamese' == $subset ) {
     804                $subsets .= ',vietnamese';
     805            }
     806
     807            $query_args = array(
     808                'family' => urlencode( 'Open Sans:400italic,700italic,400,600,700' ),
     809                'subset' => urlencode( $subsets ),
     810            );
     811
     812            $open_sans_font_url = ',' . add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
     813        }
     814
     815        return $styles . $press_this . $open_sans_font_url;
    787816    }
    788817
Note: See TracChangeset for help on using the changeset viewer.