twentyfourteen_customize_register

Implement Customizer additions and adjustments.

Description

twentyfourteen_customize_register( (WP_Customize_Manager) $wp_customize ); 

Parameters (1)

0. $wp_customize (WP_Customize_Manager)
Theme Customizer object.

Usage

  1. if ( !function_exists( 'twentyfourteen_customize_register' ) ) { 
  2. require_once '/inc/customizer.php'; 
  3.  
  4. // Theme Customizer object. 
  5. $wp_customize = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = twentyfourteen_customize_register($wp_customize); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/customizer.php  
  1. function twentyfourteen_customize_register( $wp_customize ) { 
  2. // Add custom description to Colors and Background sections. 
  3. $wp_customize->get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); 
  4. $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); 
  5.  
  6. // Add postMessage support for site title and description. 
  7. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 
  8. $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 
  9. $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; 
  10.  
  11. // Rename the label to "Site Title Color" because this only affects the site title in this theme. 
  12. $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Title Color', 'twentyfourteen' ); 
  13.  
  14. // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear. 
  15. $wp_customize->get_control( 'display_header_text' )->label = __( 'Display Site Title & Tagline', 'twentyfourteen' ); 
  16.  
  17. // Add the featured content section in case it's not already there. 
  18. $wp_customize->add_section( featured_content, array( 
  19. 'title' => __( 'Featured Content', 'twentyfourteen' ),  
  20. 'description' => sprintf( __( 'Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ), admin_url( '/edit.php?tag=featured' ), admin_url( '/edit.php?show_sticky=1' ) ),  
  21. 'priority' => 130,  
  22. ) ); 
  23.  
  24. // Add the featured content layout setting and control. 
  25. $wp_customize->add_setting( 'featured_content_layout', array( 
  26. 'default' => 'grid',  
  27. 'sanitize_callback' => 'twentyfourteen_sanitize_layout',  
  28. ) ); 
  29.  
  30. $wp_customize->add_control( 'featured_content_layout', array( 
  31. 'label' => __( 'Layout', 'twentyfourteen' ),  
  32. 'section' => featured_content,  
  33. 'type' => 'select',  
  34. 'choices' => array( 
  35. 'grid' => __( 'Grid', 'twentyfourteen' ),  
  36. 'slider' => __( 'Slider', 'twentyfourteen' ),  
  37. ),  
  38. ) );