Changeset 21639 for trunk/wp-content/themes/twentytwelve/functions.php
- Timestamp:
- 08/28/2012 02:18:43 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentytwelve/functions.php
r21620 r21639 43 43 */ 44 44 function twentytwelve_setup() { 45 global $twentytwelve_options;46 47 45 /* 48 46 * Makes Twenty Twelve available for translation. … … 54 52 load_theme_textdomain( 'twentytwelve', get_template_directory() . '/languages' ); 55 53 56 // Load up our theme options page and related code.57 require( get_template_directory() . '/inc/theme-options.php' );58 $twentytwelve_options = new Twenty_Twelve_Options();59 60 54 // This theme styles the visual editor with editor-style.css to match the theme style. 61 55 add_editor_style(); … … 95 89 */ 96 90 function twentytwelve_scripts_styles() { 97 global $twentytwelve_options;98 99 91 /* 100 92 * Adds JavaScript to pages with the comment form to support … … 111 103 /* 112 104 * Loads our special font CSS file. 113 * Depends on Theme Options setting.114 105 */ 115 $options = $twentytwelve_options->get_theme_options(); 116 if ( $options['enable_fonts'] ) 117 wp_enqueue_style( 'twentytwelve-fonts', $twentytwelve_options->custom_fonts_url(), array(), null ); 106 $protocol = is_ssl() ? 'https' : 'http'; 107 wp_enqueue_style( 'twentytwelve-fonts', "$protocol://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700", array(), null ); 118 108 119 109 /* … … 401 391 } 402 392 add_action( 'template_redirect', 'twentytwelve_content_width' ); 393 394 /** 395 * Add postMessage support for site title and description for the Theme Customizer. 396 * 397 * @since Twenty Twelve 1.0 398 * 399 * @param WP_Customize_Manager $wp_customize Theme Customizer object. 400 * @return void 401 */ 402 function twentytwelve_customize_register( $wp_customize ) { 403 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 404 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 405 } 406 add_action( 'customize_register', 'twentytwelve_customize_register' ); 407 408 /** 409 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. 410 * 411 * @since Twenty Twelve 1.0 412 */ 413 function twentytwelve_customize_preview_js() { 414 wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', true ); 415 } 416 add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
Note: See TracChangeset
for help on using the changeset viewer.