示例#1
0
 /**
  * customize_register
  * @param WP_Customizer $wp_customize
  */
 public function customize_register($wp_customize)
 {
     $wp_customize->get_setting('blogname')->transport = 'postMessage';
     $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
     $wp_customize->add_section('kotetsu_design', array('title' => __('settings', 'kotetsu'), 'priority' => 100));
     require_once get_template_directory() . '/inc/kotetsu-logo-control.php';
     $wp_customize->add_setting('logo', array('default' => $this->defaults['logo'], 'sanitize_callback' => array($this, 'sanitize_image_url')));
     $wp_customize->add_control(new Kotetsu_Logo_Control($wp_customize, 'logo', array('label' => __('Logo', 'kotetsu'), 'section' => 'kotetsu_design', 'settings' => 'logo')));
     $wp_customize->add_setting('gnav_color', array('default' => $this->defaults['gnav_color'], 'transport' => 'postMessage', 'sanitize_callback' => array($this, 'sanitize_colorcode')));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'gnav_color', array('label' => __('Global navigation color', 'kotetsu'), 'section' => 'colors', 'settings' => 'gnav_color')));
     $wp_customize->add_setting('gnav_rollover_color', array('default' => $this->defaults['gnav_rollover_color'], 'sanitize_callback' => array($this, 'sanitize_colorcode')));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'gnav_rollover_color', array('label' => __('Global navigation rollover color', 'kotetsu'), 'section' => 'colors', 'settings' => 'gnav_rollover_color')));
     $wp_customize->add_setting('font_color', array('default' => $this->defaults['font_color'], 'transport' => 'postMessage', 'sanitize_callback' => array($this, 'sanitize_colorcode')));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'font_color', array('label' => __('Font color', 'kotetsu'), 'section' => 'colors', 'settings' => 'font_color')));
     $wp_customize->add_setting('link_color', array('default' => $this->defaults['link_color'], 'transport' => 'postMessage', 'sanitize_callback' => array($this, 'sanitize_colorcode')));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'link_color', array('label' => __('Link color', 'kotetsu'), 'section' => 'colors', 'settings' => 'link_color')));
 }