wp-content/themes/twentyeleven/inc/theme-options.php:545Implements Twenty Eleven theme options into Customizer.
$wp_customizeWP_Customize_Managerfunction twentyeleven_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '#site-title a', 'container_inclusive' => false, 'render_callback' => 'twentyeleven_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '#site-description', 'container_inclusive' => false, 'render_callback' => 'twentyeleven_customize_partial_blogdescription', ) ); } $options = twentyeleven_get_theme_options(); $defaults = twentyeleven_get_default_theme_options(); $wp_customize->add_setting( 'twentyeleven_theme_options[color_scheme]', array( 'default' => $defaults['color_scheme'], 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $schemes = twentyeleven_color_schemes(); $choices = array(); foreach ( $schemes as $scheme ) { $choices[ $scheme['value'] ] = $scheme['label']; } $wp_customize->add_control( 'twentyeleven_color_scheme', array( 'label' => __( 'Color Scheme', 'twentyeleven' ), 'section' => 'colors', 'settings' => 'twentyeleven_theme_options[color_scheme]', 'type' => 'radio', 'choices' => $choices, 'priority' => 5, ) ); // Link Color (added to Color Scheme section in Customizer). $wp_customize->add_setting( 'twentyeleven_theme_options[link_color]', array( 'default' => twentyeleven_get_default_link_color( $options['color_scheme'] ), 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( 'label' => __( 'Link Color', 'twentyeleven' ), 'section' => 'colors', 'settings' => 'twentyeleven_theme_options[link_color]', ) ) ); // Default Layout. $wp_customize->add_section( 'twentyeleven_layout',Introduced in Twenty Eleven 1.3. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-content/themes/twentyeleven/inc/theme-options.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.