| 106 | | * Loads our special font CSS file. |
| 107 | | * |
| 108 | | * The use of Open Sans by default is localized. For languages that use |
| 109 | | * characters not supported by the font, the font can be disabled. |
| 110 | | * |
| 111 | | * To disable in a child theme, use wp_dequeue_style() |
| 112 | | * function mytheme_dequeue_fonts() { |
| 113 | | * wp_dequeue_style( 'twentytwelve-fonts' ); |
| 114 | | * } |
| 115 | | * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 ); |
| | 110 | * Loads our main stylesheet. |
| | 114 | /* |
| | 115 | * Loads the Internet Explorer specific stylesheet. |
| | 116 | */ |
| | 117 | wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' ); |
| | 118 | $wp_styles->add_data( 'twentytwelve-ie', 'conditional', 'lt IE 9' ); |
| | 119 | } |
| | 120 | add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' ); |
| | 121 | |
| | 122 | /** |
| | 123 | * Returns the Google font stylesheet URL if available |
| | 124 | * |
| | 125 | * The use of Open Sans by default is localized. For languages that use |
| | 126 | * characters not supported by the font, the font can be disabled. |
| | 127 | * |
| | 128 | * To disable in a child theme or plugin, use: |
| | 129 | * add_filter( 'twentytwelve_get_font_url', '__return_null' ); |
| | 130 | * |
| | 131 | * @since Twenty Twelve 1.2 |
| | 132 | * |
| | 133 | * @return string Font stylesheet or empty string if disabled |
| | 134 | */ |
| | 135 | function twentytwelve_get_font_url() { |
| | 136 | $font_url = ''; |
| | 137 | |
| 142 | | /* |
| 143 | | * Loads our main stylesheet. |
| 144 | | */ |
| 145 | | wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() ); |
| 146 | | |
| 147 | | /* |
| 148 | | * Loads the Internet Explorer specific stylesheet. |
| 149 | | */ |
| 150 | | wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' ); |
| 151 | | $wp_styles->add_data( 'twentytwelve-ie', 'conditional', 'lt IE 9' ); |
| | 162 | return apply_filters( 'twentytwelve_get_font_url', $font_url ); |
| | 461 | |
| | 462 | /** |
| | 463 | * Adds additional stylesheets to the TinyMCE editor if needed. |
| | 464 | * |
| | 465 | * @uses twentytwelve_get_font_url() To get the Google Font stylesheet URL |
| | 466 | * |
| | 467 | * @since Twenty Twelve 1.2 |
| | 468 | */ |
| | 469 | function twentytwelve_mce_css( $mce_css ) { |
| | 470 | $font_url = twentytwelve_get_font_url(); |
| | 471 | if ( empty( $font_url ) ) |
| | 472 | return $mce_css; |
| | 473 | |
| | 474 | if ( ! empty( $mce_css ) ) |
| | 475 | $mce_css .= ','; |
| | 476 | |
| | 477 | $mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) ); |
| | 478 | return $mce_css; |
| | 479 | } |
| | 480 | add_filter( 'mce_css', 'twentytwelve_mce_css' ); |
| | 481 | No newline at end of file |