Make WordPress Core

Changeset 21882


Ignore:
Timestamp:
09/17/2012 10:07:51 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Twelve: allow Open Sans to be disabled per language, since it does not support all languages, and some odd combinations of OS and browser versions don't support any non-Latin language very well.

Props obenland and SergeyBiryukov for patches, fixes #21751.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentytwelve/functions.php

    r21761 r21882  
    104104     * Loads our special font CSS file.
    105105     *
    106      * To disable in a child theme, use wp_dequeue_style()
    107      * function mytheme_dequeue_fonts() {
    108      *     wp_dequeue_style( 'twentytwelve-fonts' );
    109      * }
     106     * The use of Open Sans by default is localized. For languages that use
     107     * characters not supported by the font, the font can be disabled.
     108     *
     109     * To disable in a child theme, use wp_dequeue_style()
     110     * function mytheme_dequeue_fonts() {
     111     *     wp_dequeue_style( 'twentytwelve-fonts' );
     112     * }
    110113     * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
    111      */
    112     $protocol = is_ssl() ? 'https' : 'http';
    113     wp_enqueue_style( 'twentytwelve-fonts', "$protocol://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700", array(), null );
     114     */
     115    /* translators: If there are characters in your language that are not supported by Open Sans,
     116       enter 'disable-open-sans'. Otherwise enter 'enable-open-sans'. Do not translate into your own language. */
     117    if ( false === strpos( _x( 'enable-open-sans', 'Open Sans font: enable or disable', 'twentytwelve' ), 'disable' ) ) {
     118        $protocol = is_ssl() ? 'https' : 'http';
     119        wp_enqueue_style( 'twentytwelve-fonts', "$protocol://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700", array(), null );
     120    }
    114121
    115122    /*
Note: See TracChangeset for help on using the changeset viewer.