| 90 | | function twentytwelve_scripts_styles() { |
| 91 | | global $wp_styles; |
| 92 | | |
| 93 | | /* |
| 94 | | * Adds JavaScript to pages with the comment form to support |
| 95 | | * sites with threaded comments (when in use). |
| 96 | | */ |
| 97 | | if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) |
| 98 | | wp_enqueue_script( 'comment-reply' ); |
| 99 | | |
| 100 | | /* |
| 101 | | * Adds JavaScript for handling the navigation menu hide-and-show behavior. |
| 102 | | */ |
| 103 | | wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true ); |
| 104 | | |
| 105 | | /* |
| 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 ); |
| 116 | | */ |
| | 95 | function twentytwelve_get_font_url() { |
| | 96 | $font_url = ''; |
| | 122 | return $font_url; |
| | 123 | } |
| | 124 | |
| | 125 | /** |
| | 126 | * Enqueues scripts and styles for front-end. |
| | 127 | * |
| | 128 | * @since Twenty Twelve 1.0 |
| | 129 | */ |
| | 130 | function twentytwelve_scripts_styles() { |
| | 131 | global $wp_styles; |
| | 132 | |
| | 133 | /* |
| | 134 | * Adds JavaScript to pages with the comment form to support |
| | 135 | * sites with threaded comments (when in use). |
| | 136 | */ |
| | 137 | if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) |
| | 138 | wp_enqueue_script( 'comment-reply' ); |
| | 139 | |
| | 140 | /* |
| | 141 | * Adds JavaScript for handling the navigation menu hide-and-show behavior. |
| | 142 | */ |
| | 143 | wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true ); |
| | 144 | |
| | 145 | $font_url = twentytwelve_get_font_url(); |
| | 146 | if ( ! empty( $font_url ) ) |
| | 147 | wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null ); |
| | 148 | |
| | 163 | * Adds additional stylesheets to the TinyMCE editor if needed. |
| | 164 | * |
| | 165 | * @uses twentytwelve_get_font_url() To get the Google Font stylesheet URL. |
| | 166 | * |
| | 167 | * @since Twenty Twelve 1.2 |
| | 168 | * |
| | 169 | * @param string $mce_css CSS path to load in TinyMCE. |
| | 170 | * @return string |
| | 171 | */ |
| | 172 | function twentytwelve_mce_css( $mce_css ) { |
| | 173 | $font_url = twentytwelve_get_font_url(); |
| | 174 | |
| | 175 | if ( empty( $font_url ) ) |
| | 176 | return $mce_css; |
| | 177 | |
| | 178 | if ( ! empty( $mce_css ) ) |
| | 179 | $mce_css .= ','; |
| | 180 | |
| | 181 | $mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) ); |
| | 182 | |
| | 183 | return $mce_css; |
| | 184 | } |
| | 185 | add_filter( 'mce_css', 'twentytwelve_mce_css' ); |
| | 186 | |
| | 187 | /** |